diff --git a/src/librustc/diagnostics.rs b/src/librustc/diagnostics.rs index 6d94e1d725938f2b9c3930087b085b0dc26b7001..2878ff5e2846e4f9ad8a776d7758d1a927925e2a 100644 --- a/src/librustc/diagnostics.rs +++ b/src/librustc/diagnostics.rs @@ -1694,12 +1694,12 @@ fn main() { 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 } diff --git a/src/librustc/infer/error_reporting.rs b/src/librustc/infer/error_reporting.rs index 2bed8148b9f8c8a4e5feb0319fa5218b414efd68..d859a8b44db0c2af41723e3889427d3042cede3c 100644 --- a/src/librustc/infer/error_reporting.rs +++ b/src/librustc/infer/error_reporting.rs @@ -631,7 +631,7 @@ pub fn report_and_explain_type_error(&self, 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) diff --git a/src/test/compile-fail/E0579.rs b/src/test/compile-fail/E0580.rs similarity index 92% rename from src/test/compile-fail/E0579.rs rename to src/test/compile-fail/E0580.rs index beb6c792fa18ac9d3fd5a33589b3d4857112f3fe..a2ef7da78a84366ed2a9fcfbbf6ebfdf631909cb 100644 --- a/src/test/compile-fail/E0579.rs +++ b/src/test/compile-fail/E0580.rs @@ -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 diff --git a/src/test/compile-fail/bad-main.rs b/src/test/compile-fail/bad-main.rs index 6cd033da4bd711e7d7eac9381f8df1eeeb363eea..b73b4a6af6e89e8fdcd3e29012ab6000c85ac2bb 100644 --- a/src/test/compile-fail/bad-main.rs +++ b/src/test/compile-fail/bad-main.rs @@ -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] diff --git a/src/test/compile-fail/extern-main-fn.rs b/src/test/compile-fail/extern-main-fn.rs index 479b3e532c6b3baec316c7375388c2a3c53367da..d9bdb4ecd04777a7384fc3b08c274130a5368f57 100644 --- a/src/test/compile-fail/extern-main-fn.rs +++ b/src/test/compile-fail/extern-main-fn.rs @@ -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] diff --git a/src/test/compile-fail/main-wrong-type-2.rs b/src/test/compile-fail/main-wrong-type-2.rs index da1455403c2e3d29c2e4558cecf0032618be0388..9d74d1a90493bd8c8f08532c63685824df467c5d 100644 --- a/src/test/compile-fail/main-wrong-type-2.rs +++ b/src/test/compile-fail/main-wrong-type-2.rs @@ -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] ' ' } diff --git a/src/test/compile-fail/main-wrong-type.rs b/src/test/compile-fail/main-wrong-type.rs index dc51777503569c381db611b03db84a0f9ec0f29c..402cd3a2d31b6f2dbeeab22336c924a7361a3d60 100644 --- a/src/test/compile-fail/main-wrong-type.rs +++ b/src/test/compile-fail/main-wrong-type.rs @@ -14,5 +14,5 @@ struct S { } fn main(foo: S) { -//~^ ERROR: main function has wrong type [E0579] +//~^ ERROR: main function has wrong type [E0580] }