Update error code number
This commit is contained in:
parent
e7c3fb90ee
commit
97b9c8b8d3
@ -1694,12 +1694,12 @@ To understand better how closures work in Rust, read:
|
||||
https://doc.rust-lang.org/book/closures.html
|
||||
"##,
|
||||
|
||||
E0579: r##"
|
||||
E0580: r##"
|
||||
The `main` function was incorrectly declared.
|
||||
|
||||
Erroneous code example:
|
||||
|
||||
```compile_fail,E0579
|
||||
```compile_fail,E0580
|
||||
fn main() -> i32 { // error: main function has wrong type
|
||||
0
|
||||
}
|
||||
|
@ -631,7 +631,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
|
||||
struct_span_err!(self.tcx.sess, span, E0317, "{}", failure_str)
|
||||
}
|
||||
ObligationCauseCode::MainFunctionType => {
|
||||
struct_span_err!(self.tcx.sess, span, E0579, "{}", failure_str)
|
||||
struct_span_err!(self.tcx.sess, span, E0580, "{}", failure_str)
|
||||
}
|
||||
_ => {
|
||||
struct_span_err!(self.tcx.sess, span, E0308, "{}", failure_str)
|
||||
|
@ -8,4 +8,4 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
fn main() -> i32 { 0 } //~ ERROR E0579
|
||||
fn main() -> i32 { 0 } //~ ERROR E0580
|
@ -8,4 +8,4 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
fn main(x: isize) { } //~ ERROR: main function has wrong type [E0579]
|
||||
fn main(x: isize) { } //~ ERROR: main function has wrong type [E0580]
|
||||
|
@ -8,4 +8,4 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
extern fn main() {} //~ ERROR: main function has wrong type [E0579]
|
||||
extern fn main() {} //~ ERROR: main function has wrong type [E0580]
|
||||
|
@ -9,6 +9,6 @@
|
||||
// except according to those terms.
|
||||
|
||||
fn main() -> char {
|
||||
//~^ ERROR: main function has wrong type [E0579]
|
||||
//~^ ERROR: main function has wrong type [E0580]
|
||||
' '
|
||||
}
|
||||
|
@ -14,5 +14,5 @@ struct S {
|
||||
}
|
||||
|
||||
fn main(foo: S) {
|
||||
//~^ ERROR: main function has wrong type [E0579]
|
||||
//~^ ERROR: main function has wrong type [E0580]
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user