From c56adf64136aba153cac4600986787e8646c0811 Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Thu, 23 Aug 2018 02:19:38 +0300 Subject: [PATCH] cleanup: Add main functions to some UI tests --- src/test/ui/enum/enum-discrim-autosizing.rs | 1 + src/test/ui/enum/enum-discrim-autosizing.stderr | 9 ++------- src/test/ui/gated-bad-feature.rs | 2 ++ src/test/ui/gated-bad-feature.stderr | 8 ++------ src/test/ui/hygiene/generate-mod.rs | 2 ++ src/test/ui/hygiene/generate-mod.stderr | 9 ++------- src/test/ui/hygiene/no_implicit_prelude.rs | 2 ++ src/test/ui/hygiene/no_implicit_prelude.stderr | 8 ++------ src/test/ui/imports/import-glob-circular.rs | 2 ++ src/test/ui/imports/import-glob-circular.stderr | 9 ++------- src/test/ui/imports/import-loop-2.rs | 2 ++ src/test/ui/imports/import-loop-2.stderr | 14 ++------------ src/test/ui/invalid_crate_type_syntax.rs | 2 ++ src/test/ui/invalid_crate_type_syntax.stderr | 7 +------ src/test/ui/issues/issue-38715.rs | 2 ++ src/test/ui/issues/issue-38715.stderr | 7 +------ src/test/ui/issues/issue-42755.rs | 2 ++ src/test/ui/issues/issue-42755.stderr | 7 +------ src/test/ui/issues/issue-43784-associated-type.rs | 2 ++ .../ui/issues/issue-43784-associated-type.stderr | 9 ++------- src/test/ui/issues/issue-43784-supertrait.rs | 2 ++ src/test/ui/issues/issue-43784-supertrait.stderr | 9 ++------- src/test/ui/macros/macro-use-bad-args-1.rs | 2 ++ src/test/ui/macros/macro-use-bad-args-1.stderr | 9 ++------- src/test/ui/macros/macro-use-bad-args-2.rs | 2 ++ src/test/ui/macros/macro-use-bad-args-2.stderr | 9 ++------- src/test/ui/nested-ty-params.rs | 2 ++ src/test/ui/nested-ty-params.stderr | 9 ++------- src/test/ui/repr/repr-transparent-other-items.rs | 2 ++ .../ui/repr/repr-transparent-other-items.stderr | 8 ++------ src/test/ui/repr/repr-transparent-other-reprs.rs | 2 ++ .../ui/repr/repr-transparent-other-reprs.stderr | 9 ++------- src/test/ui/repr/repr-transparent.rs | 2 ++ src/test/ui/repr/repr-transparent.stderr | 10 +++------- src/test/ui/resolve/resolve-unknown-trait.rs | 2 ++ src/test/ui/resolve/resolve-unknown-trait.stderr | 9 ++------- src/test/ui/resolve_self_super_hint.rs | 2 ++ src/test/ui/resolve_self_super_hint.stderr | 9 ++------- .../ui/specialization/defaultimpl/validation.rs | 2 ++ .../specialization/defaultimpl/validation.stderr | 9 ++------- src/test/ui/tuple/tuple-struct-fields/test.rs | 2 ++ src/test/ui/tuple/tuple-struct-fields/test.stderr | 9 ++------- src/test/ui/unresolved/unresolved-import.rs | 2 ++ src/test/ui/unresolved/unresolved-import.stderr | 9 ++------- src/test/ui/user-defined-macro-rules.rs | 2 ++ src/test/ui/user-defined-macro-rules.stderr | 7 +------ src/test/ui/wasm-custom-section-relocations.rs | 2 ++ src/test/ui/wasm-custom-section-relocations.stderr | 7 +------ 48 files changed, 91 insertions(+), 165 deletions(-) diff --git a/src/test/ui/enum/enum-discrim-autosizing.rs b/src/test/ui/enum/enum-discrim-autosizing.rs index 3a243330ad9b0..dab22de1b6e58 100644 --- a/src/test/ui/enum/enum-discrim-autosizing.rs +++ b/src/test/ui/enum/enum-discrim-autosizing.rs @@ -18,3 +18,4 @@ enum Eu64 { Bu64 = 0x8000_0000_0000_0000 //~ERROR already exists } +fn main() {} diff --git a/src/test/ui/enum/enum-discrim-autosizing.stderr b/src/test/ui/enum/enum-discrim-autosizing.stderr index 3b4ac436898e6..e4419d6285127 100644 --- a/src/test/ui/enum/enum-discrim-autosizing.stderr +++ b/src/test/ui/enum/enum-discrim-autosizing.stderr @@ -1,7 +1,3 @@ -error[E0601]: `main` function not found in crate `enum_discrim_autosizing` - | - = note: consider adding a `main` function to `$DIR/enum-discrim-autosizing.rs` - error[E0081]: discriminant value `0` already exists --> $DIR/enum-discrim-autosizing.rs:18:12 | @@ -10,7 +6,6 @@ LL | Au64 = 0, LL | Bu64 = 0x8000_0000_0000_0000 //~ERROR already exists | ^^^^^^^^^^^^^^^^^^^^^ enum already has `0` -error: aborting due to 2 previous errors +error: aborting due to previous error -Some errors occurred: E0081, E0601. -For more information about an error, try `rustc --explain E0081`. +For more information about this error, try `rustc --explain E0081`. diff --git a/src/test/ui/gated-bad-feature.rs b/src/test/ui/gated-bad-feature.rs index 5baafd4153159..0d74f9011c3ec 100644 --- a/src/test/ui/gated-bad-feature.rs +++ b/src/test/ui/gated-bad-feature.rs @@ -20,3 +20,5 @@ #![feature = "foo"] //~ ERROR: malformed feature #![feature(test_removed_feature)] //~ ERROR: feature has been removed + +fn main() {} diff --git a/src/test/ui/gated-bad-feature.stderr b/src/test/ui/gated-bad-feature.stderr index 2bed241d68cab..68be49a7277d2 100644 --- a/src/test/ui/gated-bad-feature.stderr +++ b/src/test/ui/gated-bad-feature.stderr @@ -28,11 +28,7 @@ error[E0557]: feature has been removed LL | #![feature(test_removed_feature)] //~ ERROR: feature has been removed | ^^^^^^^^^^^^^^^^^^^^ -error[E0601]: `main` function not found in crate `gated_bad_feature` - | - = note: consider adding a `main` function to `$DIR/gated-bad-feature.rs` - -error: aborting due to 6 previous errors +error: aborting due to 5 previous errors -Some errors occurred: E0555, E0556, E0557, E0601. +Some errors occurred: E0555, E0556, E0557. For more information about an error, try `rustc --explain E0555`. diff --git a/src/test/ui/hygiene/generate-mod.rs b/src/test/ui/hygiene/generate-mod.rs index 2b2108558a0f3..efb3696cf8513 100644 --- a/src/test/ui/hygiene/generate-mod.rs +++ b/src/test/ui/hygiene/generate-mod.rs @@ -55,3 +55,5 @@ fn check_legacy() { struct FromOutside; genmod_legacy!(); } + +fn main() {} diff --git a/src/test/ui/hygiene/generate-mod.stderr b/src/test/ui/hygiene/generate-mod.stderr index 0c5905c5acb4f..f86444bae77e8 100644 --- a/src/test/ui/hygiene/generate-mod.stderr +++ b/src/test/ui/hygiene/generate-mod.stderr @@ -46,11 +46,6 @@ LL | type Inner = Outer; //~ ERROR cannot find type `Outer` in this scop LL | genmod_legacy!(); | ----------------- in this macro invocation -error[E0601]: `main` function not found in crate `generate_mod` - | - = note: consider adding a `main` function to `$DIR/generate-mod.rs` - -error: aborting due to 7 previous errors +error: aborting due to 6 previous errors -Some errors occurred: E0412, E0601. -For more information about an error, try `rustc --explain E0412`. +For more information about this error, try `rustc --explain E0412`. diff --git a/src/test/ui/hygiene/no_implicit_prelude.rs b/src/test/ui/hygiene/no_implicit_prelude.rs index c90c7b3093c9f..bf07bc05491cc 100644 --- a/src/test/ui/hygiene/no_implicit_prelude.rs +++ b/src/test/ui/hygiene/no_implicit_prelude.rs @@ -23,3 +23,5 @@ mod bar { } fn f() { ::foo::m!(); } } + +fn main() {} diff --git a/src/test/ui/hygiene/no_implicit_prelude.stderr b/src/test/ui/hygiene/no_implicit_prelude.stderr index b3d82e9094ba7..463fdbf00ce54 100644 --- a/src/test/ui/hygiene/no_implicit_prelude.stderr +++ b/src/test/ui/hygiene/no_implicit_prelude.stderr @@ -7,10 +7,6 @@ LL | fn f() { ::bar::m!(); } LL | Vec::new(); //~ ERROR failed to resolve | ^^^ Use of undeclared type or module `Vec` -error[E0601]: `main` function not found in crate `no_implicit_prelude` - | - = note: consider adding a `main` function to `$DIR/no_implicit_prelude.rs` - error[E0599]: no method named `clone` found for type `()` in the current scope --> $DIR/no_implicit_prelude.rs:22:12 | @@ -24,7 +20,7 @@ LL | ().clone() //~ ERROR no method named `clone` found = note: the following trait is implemented but not in scope, perhaps add a `use` for it: `use std::clone::Clone;` -error: aborting due to 3 previous errors +error: aborting due to 2 previous errors -Some errors occurred: E0433, E0599, E0601. +Some errors occurred: E0433, E0599. For more information about an error, try `rustc --explain E0433`. diff --git a/src/test/ui/imports/import-glob-circular.rs b/src/test/ui/imports/import-glob-circular.rs index d9cc17791ed56..b2e92fe0e1bf9 100644 --- a/src/test/ui/imports/import-glob-circular.rs +++ b/src/test/ui/imports/import-glob-circular.rs @@ -25,3 +25,5 @@ mod test { fn test() { f1066(); } //~ ERROR cannot find function `f1066` in this scope } + +fn main() {} diff --git a/src/test/ui/imports/import-glob-circular.stderr b/src/test/ui/imports/import-glob-circular.stderr index 078a6a3937a47..fdff04cc24148 100644 --- a/src/test/ui/imports/import-glob-circular.stderr +++ b/src/test/ui/imports/import-glob-circular.stderr @@ -4,11 +4,6 @@ error[E0425]: cannot find function `f1066` in this scope LL | fn test() { f1066(); } //~ ERROR cannot find function `f1066` in this scope | ^^^^^ not found in this scope -error[E0601]: `main` function not found in crate `import_glob_circular` - | - = note: consider adding a `main` function to `$DIR/import-glob-circular.rs` - -error: aborting due to 2 previous errors +error: aborting due to previous error -Some errors occurred: E0425, E0601. -For more information about an error, try `rustc --explain E0425`. +For more information about this error, try `rustc --explain E0425`. diff --git a/src/test/ui/imports/import-loop-2.rs b/src/test/ui/imports/import-loop-2.rs index b7bbe11a4dc96..0bc968872db5b 100644 --- a/src/test/ui/imports/import-loop-2.rs +++ b/src/test/ui/imports/import-loop-2.rs @@ -19,3 +19,5 @@ mod b { fn main() { let y = x; } } + +fn main() {} diff --git a/src/test/ui/imports/import-loop-2.stderr b/src/test/ui/imports/import-loop-2.stderr index 717f74643ebb4..09c2e7918f376 100644 --- a/src/test/ui/imports/import-loop-2.stderr +++ b/src/test/ui/imports/import-loop-2.stderr @@ -4,16 +4,6 @@ error[E0432]: unresolved import `a::x` LL | pub use a::x; | ^^^^ no `x` in `a` -error[E0601]: `main` function not found in crate `import_loop_2` - | - = note: the main function must be defined at the crate level but you have one or more functions named 'main' that are not defined at the crate level. Either move the definition or attach the `#[main]` attribute to override this behavior. -note: here is a function named 'main' - --> $DIR/import-loop-2.rs:20:5 - | -LL | fn main() { let y = x; } - | ^^^^^^^^^^^^^^^^^^^^^^^^ - -error: aborting due to 2 previous errors +error: aborting due to previous error -Some errors occurred: E0432, E0601. -For more information about an error, try `rustc --explain E0432`. +For more information about this error, try `rustc --explain E0432`. diff --git a/src/test/ui/invalid_crate_type_syntax.rs b/src/test/ui/invalid_crate_type_syntax.rs index 6d42515704ea1..904a9acf9e530 100644 --- a/src/test/ui/invalid_crate_type_syntax.rs +++ b/src/test/ui/invalid_crate_type_syntax.rs @@ -12,3 +12,5 @@ #![crate_type(lib)] //~ ERROR `crate_type` requires a value fn my_lib_fn() {} + +fn main() {} diff --git a/src/test/ui/invalid_crate_type_syntax.stderr b/src/test/ui/invalid_crate_type_syntax.stderr index b609695b86ee5..6f02f96faca93 100644 --- a/src/test/ui/invalid_crate_type_syntax.stderr +++ b/src/test/ui/invalid_crate_type_syntax.stderr @@ -6,10 +6,5 @@ LL | #![crate_type(lib)] //~ ERROR `crate_type` requires a value | = note: for example: `#![crate_type="lib"]` -error[E0601]: `main` function not found in crate `invalid_crate_type_syntax` - | - = note: consider adding a `main` function to `$DIR/invalid_crate_type_syntax.rs` - -error: aborting due to 2 previous errors +error: aborting due to previous error -For more information about this error, try `rustc --explain E0601`. diff --git a/src/test/ui/issues/issue-38715.rs b/src/test/ui/issues/issue-38715.rs index 552653c21bad6..5c745d1fab3b5 100644 --- a/src/test/ui/issues/issue-38715.rs +++ b/src/test/ui/issues/issue-38715.rs @@ -14,3 +14,5 @@ macro_rules! foo { ($i:ident) => {} } #[macro_export] macro_rules! foo { () => {} } //~ ERROR a macro named `foo` has already been exported //~| WARN this was previously accepted + +fn main() {} diff --git a/src/test/ui/issues/issue-38715.stderr b/src/test/ui/issues/issue-38715.stderr index a0dbcbd18c673..67b27cc83cc89 100644 --- a/src/test/ui/issues/issue-38715.stderr +++ b/src/test/ui/issues/issue-38715.stderr @@ -13,10 +13,5 @@ note: previous macro export is now shadowed LL | macro_rules! foo { ($i:ident) => {} } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error[E0601]: `main` function not found in crate `issue_38715` - | - = note: consider adding a `main` function to `$DIR/issue-38715.rs` - -error: aborting due to 2 previous errors +error: aborting due to previous error -For more information about this error, try `rustc --explain E0601`. diff --git a/src/test/ui/issues/issue-42755.rs b/src/test/ui/issues/issue-42755.rs index dd53a1c71a5bc..46c8cb740ded7 100644 --- a/src/test/ui/issues/issue-42755.rs +++ b/src/test/ui/issues/issue-42755.rs @@ -15,3 +15,5 @@ macro_rules! foo { } foo!(a); + +fn main() {} diff --git a/src/test/ui/issues/issue-42755.stderr b/src/test/ui/issues/issue-42755.stderr index 9143906199616..fa736edc47f5b 100644 --- a/src/test/ui/issues/issue-42755.stderr +++ b/src/test/ui/issues/issue-42755.stderr @@ -4,10 +4,5 @@ error: repetition matches empty token tree LL | ($($p:vis)*) => {} //~ ERROR repetition matches empty token tree | ^^^^^^^^ -error[E0601]: `main` function not found in crate `issue_42755` - | - = note: consider adding a `main` function to `$DIR/issue-42755.rs` - -error: aborting due to 2 previous errors +error: aborting due to previous error -For more information about this error, try `rustc --explain E0601`. diff --git a/src/test/ui/issues/issue-43784-associated-type.rs b/src/test/ui/issues/issue-43784-associated-type.rs index 94b5c0034a76d..1ff1238ec54b8 100644 --- a/src/test/ui/issues/issue-43784-associated-type.rs +++ b/src/test/ui/issues/issue-43784-associated-type.rs @@ -23,3 +23,5 @@ impl Partial for T::Assoc where impl Complete for T { //~ ERROR the trait bound `T: std::marker::Copy` is not satisfied type Assoc = T; } + +fn main() {} diff --git a/src/test/ui/issues/issue-43784-associated-type.stderr b/src/test/ui/issues/issue-43784-associated-type.stderr index 798d8c6601668..18e97e24b733a 100644 --- a/src/test/ui/issues/issue-43784-associated-type.stderr +++ b/src/test/ui/issues/issue-43784-associated-type.stderr @@ -1,7 +1,3 @@ -error[E0601]: `main` function not found in crate `issue_43784_associated_type` - | - = note: consider adding a `main` function to `$DIR/issue-43784-associated-type.rs` - error[E0277]: the trait bound `T: std::marker::Copy` is not satisfied --> $DIR/issue-43784-associated-type.rs:23:9 | @@ -10,7 +6,6 @@ LL | impl Complete for T { //~ ERROR the trait bound `T: std::marker::Copy` i | = help: consider adding a `where T: std::marker::Copy` bound -error: aborting due to 2 previous errors +error: aborting due to previous error -Some errors occurred: E0277, E0601. -For more information about an error, try `rustc --explain E0277`. +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/issues/issue-43784-supertrait.rs b/src/test/ui/issues/issue-43784-supertrait.rs index e70df113da33c..30132c3be88a7 100644 --- a/src/test/ui/issues/issue-43784-supertrait.rs +++ b/src/test/ui/issues/issue-43784-supertrait.rs @@ -16,3 +16,5 @@ pub trait Complete: Partial { impl Partial for T where T: Complete {} impl Complete for T {} //~ ERROR the trait bound `T: std::marker::Copy` is not satisfied + +fn main() {} diff --git a/src/test/ui/issues/issue-43784-supertrait.stderr b/src/test/ui/issues/issue-43784-supertrait.stderr index 8646b315abdab..422075f62aa0d 100644 --- a/src/test/ui/issues/issue-43784-supertrait.stderr +++ b/src/test/ui/issues/issue-43784-supertrait.stderr @@ -1,7 +1,3 @@ -error[E0601]: `main` function not found in crate `issue_43784_supertrait` - | - = note: consider adding a `main` function to `$DIR/issue-43784-supertrait.rs` - error[E0277]: the trait bound `T: std::marker::Copy` is not satisfied --> $DIR/issue-43784-supertrait.rs:18:9 | @@ -10,7 +6,6 @@ LL | impl Complete for T {} //~ ERROR the trait bound `T: std::marker::Copy` | = help: consider adding a `where T: std::marker::Copy` bound -error: aborting due to 2 previous errors +error: aborting due to previous error -Some errors occurred: E0277, E0601. -For more information about an error, try `rustc --explain E0277`. +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/macros/macro-use-bad-args-1.rs b/src/test/ui/macros/macro-use-bad-args-1.rs index a07cc83441173..fefc6ff6ca615 100644 --- a/src/test/ui/macros/macro-use-bad-args-1.rs +++ b/src/test/ui/macros/macro-use-bad-args-1.rs @@ -13,3 +13,5 @@ #[allow(unused_extern_crates)] #[macro_use(foo(bar))] //~ ERROR bad macro import extern crate std; + +fn main() {} diff --git a/src/test/ui/macros/macro-use-bad-args-1.stderr b/src/test/ui/macros/macro-use-bad-args-1.stderr index 19a8c7c0382d1..308fb6c76e1b9 100644 --- a/src/test/ui/macros/macro-use-bad-args-1.stderr +++ b/src/test/ui/macros/macro-use-bad-args-1.stderr @@ -4,11 +4,6 @@ error[E0466]: bad macro import LL | #[macro_use(foo(bar))] //~ ERROR bad macro import | ^^^^^^^^ -error[E0601]: `main` function not found in crate `macro_use_bad_args_1` - | - = note: consider adding a `main` function to `$DIR/macro-use-bad-args-1.rs` - -error: aborting due to 2 previous errors +error: aborting due to previous error -Some errors occurred: E0466, E0601. -For more information about an error, try `rustc --explain E0466`. +For more information about this error, try `rustc --explain E0466`. diff --git a/src/test/ui/macros/macro-use-bad-args-2.rs b/src/test/ui/macros/macro-use-bad-args-2.rs index 89004f1689774..81352cf2e427d 100644 --- a/src/test/ui/macros/macro-use-bad-args-2.rs +++ b/src/test/ui/macros/macro-use-bad-args-2.rs @@ -13,3 +13,5 @@ #[allow(unused_extern_crates)] #[macro_use(foo="bar")] //~ ERROR bad macro import extern crate std; + +fn main() {} diff --git a/src/test/ui/macros/macro-use-bad-args-2.stderr b/src/test/ui/macros/macro-use-bad-args-2.stderr index 0ac18201d791e..62e3c22fab3ec 100644 --- a/src/test/ui/macros/macro-use-bad-args-2.stderr +++ b/src/test/ui/macros/macro-use-bad-args-2.stderr @@ -4,11 +4,6 @@ error[E0466]: bad macro import LL | #[macro_use(foo="bar")] //~ ERROR bad macro import | ^^^^^^^^^ -error[E0601]: `main` function not found in crate `macro_use_bad_args_2` - | - = note: consider adding a `main` function to `$DIR/macro-use-bad-args-2.rs` - -error: aborting due to 2 previous errors +error: aborting due to previous error -Some errors occurred: E0466, E0601. -For more information about an error, try `rustc --explain E0466`. +For more information about this error, try `rustc --explain E0466`. diff --git a/src/test/ui/nested-ty-params.rs b/src/test/ui/nested-ty-params.rs index aac37289bb749..2378cccf56f76 100644 --- a/src/test/ui/nested-ty-params.rs +++ b/src/test/ui/nested-ty-params.rs @@ -14,3 +14,5 @@ fn hd(v: Vec ) -> U { return hd1(v); } + +fn main() {} diff --git a/src/test/ui/nested-ty-params.stderr b/src/test/ui/nested-ty-params.stderr index 93b934f610f8c..58b6cd18989f2 100644 --- a/src/test/ui/nested-ty-params.stderr +++ b/src/test/ui/nested-ty-params.stderr @@ -18,11 +18,6 @@ LL | fn hd1(w: [U]) -> U { return w[0]; } | | | help: try using a local type parameter instead: `hd1` -error[E0601]: `main` function not found in crate `nested_ty_params` - | - = note: consider adding a `main` function to `$DIR/nested-ty-params.rs` - -error: aborting due to 3 previous errors +error: aborting due to 2 previous errors -Some errors occurred: E0401, E0601. -For more information about an error, try `rustc --explain E0401`. +For more information about this error, try `rustc --explain E0401`. diff --git a/src/test/ui/repr/repr-transparent-other-items.rs b/src/test/ui/repr/repr-transparent-other-items.rs index 685d62dc3a9c8..be6f3cf9eb205 100644 --- a/src/test/ui/repr/repr-transparent-other-items.rs +++ b/src/test/ui/repr/repr-transparent-other-items.rs @@ -36,3 +36,5 @@ fn cant_repr_this() {} #[repr(transparent)] //~ ERROR should be applied to struct static CANT_REPR_THIS: u32 = 0; + +fn main() {} diff --git a/src/test/ui/repr/repr-transparent-other-items.stderr b/src/test/ui/repr/repr-transparent-other-items.stderr index e5889cf53e58a..5a1978991480e 100644 --- a/src/test/ui/repr/repr-transparent-other-items.stderr +++ b/src/test/ui/repr/repr-transparent-other-items.stderr @@ -1,7 +1,3 @@ -error[E0601]: `main` function not found in crate `repr_transparent_other_items` - | - = note: consider adding a `main` function to `$DIR/repr-transparent-other-items.rs` - error[E0517]: attribute should be applied to struct --> $DIR/repr-transparent-other-items.rs:13:8 | @@ -67,7 +63,7 @@ LL | #[repr(transparent)] //~ ERROR unsupported representation for zero-variant LL | enum Void {} //~| ERROR should be applied to struct | ------------ zero-variant enum -error: aborting due to 8 previous errors +error: aborting due to 7 previous errors -Some errors occurred: E0084, E0517, E0601. +Some errors occurred: E0084, E0517. For more information about an error, try `rustc --explain E0084`. diff --git a/src/test/ui/repr/repr-transparent-other-reprs.rs b/src/test/ui/repr/repr-transparent-other-reprs.rs index fa5f1a2f7fb80..aed8a69f66ef8 100644 --- a/src/test/ui/repr/repr-transparent-other-reprs.rs +++ b/src/test/ui/repr/repr-transparent-other-reprs.rs @@ -26,3 +26,5 @@ struct TransparentPlusAlign(u8); #[repr(transparent)] //~ ERROR cannot have other repr #[repr(C)] struct SeparateAttributes(*mut u8); + +fn main() {} diff --git a/src/test/ui/repr/repr-transparent-other-reprs.stderr b/src/test/ui/repr/repr-transparent-other-reprs.stderr index 40f41c474dbda..c8f5dea3c1242 100644 --- a/src/test/ui/repr/repr-transparent-other-reprs.stderr +++ b/src/test/ui/repr/repr-transparent-other-reprs.stderr @@ -1,7 +1,3 @@ -error[E0601]: `main` function not found in crate `repr_transparent_other_reprs` - | - = note: consider adding a `main` function to `$DIR/repr-transparent-other-reprs.rs` - error[E0692]: transparent struct cannot have other repr hints --> $DIR/repr-transparent-other-reprs.rs:15:8 | @@ -28,7 +24,6 @@ LL | #[repr(transparent)] //~ ERROR cannot have other repr LL | #[repr(C)] | ^ -error: aborting due to 5 previous errors +error: aborting due to 4 previous errors -Some errors occurred: E0601, E0692. -For more information about an error, try `rustc --explain E0601`. +For more information about this error, try `rustc --explain E0692`. diff --git a/src/test/ui/repr/repr-transparent.rs b/src/test/ui/repr/repr-transparent.rs index 230573247316e..f5b99af156ee0 100644 --- a/src/test/ui/repr/repr-transparent.rs +++ b/src/test/ui/repr/repr-transparent.rs @@ -48,3 +48,5 @@ struct ZstAlign32(PhantomData); #[repr(transparent)] struct GenericAlign(ZstAlign32, u32); //~ ERROR alignment larger than 1 + +fn main() {} diff --git a/src/test/ui/repr/repr-transparent.stderr b/src/test/ui/repr/repr-transparent.stderr index 0f620880fa9d3..f7bfdbdc625bb 100644 --- a/src/test/ui/repr/repr-transparent.stderr +++ b/src/test/ui/repr/repr-transparent.stderr @@ -1,7 +1,3 @@ -error[E0601]: `main` function not found in crate `repr_transparent` - | - = note: consider adding a `main` function to `$DIR/repr-transparent.rs` - error[E0690]: transparent struct needs exactly one non-zero-sized field, but has 0 --> $DIR/repr-transparent.rs:21:1 | @@ -70,7 +66,7 @@ error[E0691]: zero-sized field in transparent struct has alignment larger than 1 LL | struct GenericAlign(ZstAlign32, u32); //~ ERROR alignment larger than 1 | ^^^^^^^^^^^^^ -error: aborting due to 9 previous errors +error: aborting due to 8 previous errors -Some errors occurred: E0601, E0690, E0691. -For more information about an error, try `rustc --explain E0601`. +Some errors occurred: E0690, E0691. +For more information about an error, try `rustc --explain E0690`. diff --git a/src/test/ui/resolve/resolve-unknown-trait.rs b/src/test/ui/resolve/resolve-unknown-trait.rs index 9432e727fa5b7..05bf4b928b725 100644 --- a/src/test/ui/resolve/resolve-unknown-trait.rs +++ b/src/test/ui/resolve/resolve-unknown-trait.rs @@ -17,3 +17,5 @@ impl SomeNonExistentTrait for isize {} fn f() {} //~^ ERROR cannot find trait `SomeNonExistentTrait` in this scope + +fn main() {} diff --git a/src/test/ui/resolve/resolve-unknown-trait.stderr b/src/test/ui/resolve/resolve-unknown-trait.stderr index 8a2d791654d2f..74b190f86845f 100644 --- a/src/test/ui/resolve/resolve-unknown-trait.stderr +++ b/src/test/ui/resolve/resolve-unknown-trait.stderr @@ -16,11 +16,6 @@ error[E0405]: cannot find trait `SomeNonExistentTrait` in this scope LL | fn f() {} | ^^^^^^^^^^^^^^^^^^^^ not found in this scope -error[E0601]: `main` function not found in crate `resolve_unknown_trait` - | - = note: consider adding a `main` function to `$DIR/resolve-unknown-trait.rs` - -error: aborting due to 4 previous errors +error: aborting due to 3 previous errors -Some errors occurred: E0405, E0601. -For more information about an error, try `rustc --explain E0405`. +For more information about this error, try `rustc --explain E0405`. diff --git a/src/test/ui/resolve_self_super_hint.rs b/src/test/ui/resolve_self_super_hint.rs index a89fd802baf0c..c5dd367c0ab88 100644 --- a/src/test/ui/resolve_self_super_hint.rs +++ b/src/test/ui/resolve_self_super_hint.rs @@ -32,3 +32,5 @@ mod a { } } } + +fn main() {} diff --git a/src/test/ui/resolve_self_super_hint.stderr b/src/test/ui/resolve_self_super_hint.stderr index 8538da06baf64..40b2a4bf96842 100644 --- a/src/test/ui/resolve_self_super_hint.stderr +++ b/src/test/ui/resolve_self_super_hint.stderr @@ -22,11 +22,6 @@ error[E0432]: unresolved import `alloc` LL | use alloc::HashMap; | ^^^^^ Did you mean `a::alloc`? -error[E0601]: `main` function not found in crate `resolve_self_super_hint` - | - = note: consider adding a `main` function to `$DIR/resolve_self_super_hint.rs` - -error: aborting due to 5 previous errors +error: aborting due to 4 previous errors -Some errors occurred: E0432, E0601. -For more information about an error, try `rustc --explain E0432`. +For more information about this error, try `rustc --explain E0432`. diff --git a/src/test/ui/specialization/defaultimpl/validation.rs b/src/test/ui/specialization/defaultimpl/validation.rs index 26b8b737f340d..068eb7a448556 100644 --- a/src/test/ui/specialization/defaultimpl/validation.rs +++ b/src/test/ui/specialization/defaultimpl/validation.rs @@ -21,3 +21,5 @@ default impl !Send for Z {} //~ ERROR impls of auto traits cannot be default trait Tr {} default impl !Tr for S {} //~ ERROR negative impls are only allowed for auto traits + +fn main() {} diff --git a/src/test/ui/specialization/defaultimpl/validation.stderr b/src/test/ui/specialization/defaultimpl/validation.stderr index 54b92da7b2192..c25c428eb4e94 100644 --- a/src/test/ui/specialization/defaultimpl/validation.stderr +++ b/src/test/ui/specialization/defaultimpl/validation.stderr @@ -6,10 +6,6 @@ LL | default impl S {} //~ ERROR inherent impls cannot be default | = note: only trait implementations may be annotated with default -error[E0601]: `main` function not found in crate `validation` - | - = note: consider adding a `main` function to `$DIR/validation.rs` - error: impls of auto traits cannot be default --> $DIR/validation.rs:19:1 | @@ -28,7 +24,6 @@ error[E0192]: negative impls are only allowed for auto traits (e.g., `Send` and LL | default impl !Tr for S {} //~ ERROR negative impls are only allowed for auto traits | ^^^^^^^^^^^^^^^^^^^^^^^^^ -error: aborting due to 5 previous errors +error: aborting due to 4 previous errors -Some errors occurred: E0192, E0601. -For more information about an error, try `rustc --explain E0192`. +For more information about this error, try `rustc --explain E0192`. diff --git a/src/test/ui/tuple/tuple-struct-fields/test.rs b/src/test/ui/tuple/tuple-struct-fields/test.rs index 22d54a3834073..c8b77bfabdb95 100644 --- a/src/test/ui/tuple/tuple-struct-fields/test.rs +++ b/src/test/ui/tuple/tuple-struct-fields/test.rs @@ -15,3 +15,5 @@ mod foo { //~^ ERROR expected one of `)` or `,`, found `(` //~| ERROR cannot find type `foo` in this scope } + +fn main() {} diff --git a/src/test/ui/tuple/tuple-struct-fields/test.stderr b/src/test/ui/tuple/tuple-struct-fields/test.stderr index 59228ea8c14d2..f83e9dd5458fb 100644 --- a/src/test/ui/tuple/tuple-struct-fields/test.stderr +++ b/src/test/ui/tuple/tuple-struct-fields/test.stderr @@ -10,11 +10,6 @@ error[E0412]: cannot find type `foo` in this scope LL | struct S2(pub((foo)) ()); | ^^^ not found in this scope -error[E0601]: `main` function not found in crate `test` - | - = note: consider adding a `main` function to `$DIR/test.rs` - -error: aborting due to 3 previous errors +error: aborting due to 2 previous errors -Some errors occurred: E0412, E0601. -For more information about an error, try `rustc --explain E0412`. +For more information about this error, try `rustc --explain E0412`. diff --git a/src/test/ui/unresolved/unresolved-import.rs b/src/test/ui/unresolved/unresolved-import.rs index a3eeb6de96bda..efa7494647691 100644 --- a/src/test/ui/unresolved/unresolved-import.rs +++ b/src/test/ui/unresolved/unresolved-import.rs @@ -55,3 +55,5 @@ mod items { fn item() {} } + +fn main() {} diff --git a/src/test/ui/unresolved/unresolved-import.stderr b/src/test/ui/unresolved/unresolved-import.stderr index 1e663cde48a65..9bcebb0011a75 100644 --- a/src/test/ui/unresolved/unresolved-import.stderr +++ b/src/test/ui/unresolved/unresolved-import.stderr @@ -34,11 +34,6 @@ error[E0432]: unresolved import `Enum` LL | use Enum::*; //~ ERROR unresolved import `Enum` [E0432] | ^^^^ Did you mean `self::Enum`? -error[E0601]: `main` function not found in crate `unresolved_import` - | - = note: consider adding a `main` function to `$DIR/unresolved-import.rs` - -error: aborting due to 7 previous errors +error: aborting due to 6 previous errors -Some errors occurred: E0432, E0601. -For more information about an error, try `rustc --explain E0432`. +For more information about this error, try `rustc --explain E0432`. diff --git a/src/test/ui/user-defined-macro-rules.rs b/src/test/ui/user-defined-macro-rules.rs index 02e1a585fa89d..fe76d58f1ef76 100644 --- a/src/test/ui/user-defined-macro-rules.rs +++ b/src/test/ui/user-defined-macro-rules.rs @@ -11,3 +11,5 @@ #![allow(unused_macros)] macro_rules! macro_rules { () => {} } //~ ERROR user-defined macros may not be named `macro_rules` + +fn main() {} diff --git a/src/test/ui/user-defined-macro-rules.stderr b/src/test/ui/user-defined-macro-rules.stderr index 3359aa4bcd720..1f8b18166c9c9 100644 --- a/src/test/ui/user-defined-macro-rules.stderr +++ b/src/test/ui/user-defined-macro-rules.stderr @@ -4,10 +4,5 @@ error: user-defined macros may not be named `macro_rules` LL | macro_rules! macro_rules { () => {} } //~ ERROR user-defined macros may not be named `macro_rules` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error[E0601]: `main` function not found in crate `user_defined_macro_rules` - | - = note: consider adding a `main` function to `$DIR/user-defined-macro-rules.rs` - -error: aborting due to 2 previous errors +error: aborting due to previous error -For more information about this error, try `rustc --explain E0601`. diff --git a/src/test/ui/wasm-custom-section-relocations.rs b/src/test/ui/wasm-custom-section-relocations.rs index 5631a70192afd..9f431e7806139 100644 --- a/src/test/ui/wasm-custom-section-relocations.rs +++ b/src/test/ui/wasm-custom-section-relocations.rs @@ -21,3 +21,5 @@ pub static C: usize = 3; #[link_section = "test"] pub static D: &usize = &C; //~ ERROR: no extra levels of indirection + +fn main() {} diff --git a/src/test/ui/wasm-custom-section-relocations.stderr b/src/test/ui/wasm-custom-section-relocations.stderr index 9b96b99e02ae4..cea6e5c41923a 100644 --- a/src/test/ui/wasm-custom-section-relocations.stderr +++ b/src/test/ui/wasm-custom-section-relocations.stderr @@ -1,7 +1,3 @@ -error[E0601]: `main` function not found in crate `wasm_custom_section_relocations` - | - = note: consider adding a `main` function to `$DIR/wasm-custom-section-relocations.rs` - error: statics with a custom `#[link_section]` must be a simple list of bytes on the wasm target with no extra levels of indirection such as references --> $DIR/wasm-custom-section-relocations.rs:14:1 | @@ -14,6 +10,5 @@ error: statics with a custom `#[link_section]` must be a simple list of bytes on LL | pub static D: &usize = &C; //~ ERROR: no extra levels of indirection | ^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: aborting due to 3 previous errors +error: aborting due to 2 previous errors -For more information about this error, try `rustc --explain E0601`.