Rollup merge of #53622 - petrochenkov:nomain, r=oli-obk

cleanup: Add main functions to some UI tests
This commit is contained in:
kennytm 2018-09-01 21:14:07 +08:00 committed by GitHub
commit 9d80c65be2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
48 changed files with 91 additions and 165 deletions

View File

@ -18,3 +18,4 @@ enum Eu64 {
Bu64 = 0x8000_0000_0000_0000 //~ERROR already exists
}
fn main() {}

View File

@ -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`.

View File

@ -20,3 +20,5 @@
#![feature = "foo"] //~ ERROR: malformed feature
#![feature(test_removed_feature)] //~ ERROR: feature has been removed
fn main() {}

View File

@ -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 5 previous errors
error: aborting due to 6 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`.

View File

@ -55,3 +55,5 @@ fn check_legacy() {
struct FromOutside;
genmod_legacy!();
}
fn main() {}

View File

@ -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 6 previous errors
error: aborting due to 7 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`.

View File

@ -23,3 +23,5 @@ mod bar {
}
fn f() { ::foo::m!(); }
}
fn main() {}

View File

@ -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`.

View File

@ -25,3 +25,5 @@ mod test {
fn test() { f1066(); } //~ ERROR cannot find function `f1066` in this scope
}
fn main() {}

View File

@ -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 previous error
error: aborting due to 2 previous errors
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`.

View File

@ -19,3 +19,5 @@ mod b {
fn main() { let y = x; }
}
fn main() {}

View File

@ -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 previous error
error: aborting due to 2 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`.

View File

@ -12,3 +12,5 @@
#![crate_type(lib)] //~ ERROR `crate_type` requires a value
fn my_lib_fn() {}
fn main() {}

View File

@ -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 previous error
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0601`.

View File

@ -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() {}

View File

@ -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 previous error
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0601`.

View File

@ -15,3 +15,5 @@ macro_rules! foo {
}
foo!(a);
fn main() {}

View File

@ -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 previous error
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0601`.

View File

@ -23,3 +23,5 @@ impl<T> Partial<T> for T::Assoc where
impl<T> Complete for T { //~ ERROR the trait bound `T: std::marker::Copy` is not satisfied
type Assoc = T;
}
fn main() {}

View File

@ -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<T> 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`.

View File

@ -16,3 +16,5 @@ pub trait Complete: Partial {
impl<T> Partial for T where T: Complete {}
impl<T> Complete for T {} //~ ERROR the trait bound `T: std::marker::Copy` is not satisfied
fn main() {}

View File

@ -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<T> 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`.

View File

@ -13,3 +13,5 @@
#[allow(unused_extern_crates)]
#[macro_use(foo(bar))] //~ ERROR bad macro import
extern crate std;
fn main() {}

View File

@ -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 previous error
error: aborting due to 2 previous errors
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`.

View File

@ -13,3 +13,5 @@
#[allow(unused_extern_crates)]
#[macro_use(foo="bar")] //~ ERROR bad macro import
extern crate std;
fn main() {}

View File

@ -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 previous error
error: aborting due to 2 previous errors
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`.

View File

@ -14,3 +14,5 @@ fn hd<U>(v: Vec<U> ) -> U {
return hd1(v);
}
fn main() {}

View File

@ -18,11 +18,6 @@ LL | fn hd1(w: [U]) -> U { return w[0]; }
| |
| help: try using a local type parameter instead: `hd1<U>`
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 2 previous errors
error: aborting due to 3 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`.

View File

@ -36,3 +36,5 @@ fn cant_repr_this() {}
#[repr(transparent)] //~ ERROR should be applied to struct
static CANT_REPR_THIS: u32 = 0;
fn main() {}

View File

@ -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`.

View File

@ -26,3 +26,5 @@ struct TransparentPlusAlign(u8);
#[repr(transparent)] //~ ERROR cannot have other repr
#[repr(C)]
struct SeparateAttributes(*mut u8);
fn main() {}

View File

@ -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`.

View File

@ -48,3 +48,5 @@ struct ZstAlign32<T>(PhantomData<T>);
#[repr(transparent)]
struct GenericAlign<T>(ZstAlign32<T>, u32); //~ ERROR alignment larger than 1
fn main() {}

View File

@ -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<T>(ZstAlign32<T>, 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`.

View File

@ -17,3 +17,5 @@ impl SomeNonExistentTrait for isize {}
fn f<T:SomeNonExistentTrait>() {}
//~^ ERROR cannot find trait `SomeNonExistentTrait` in this scope
fn main() {}

View File

@ -16,11 +16,6 @@ error[E0405]: cannot find trait `SomeNonExistentTrait` in this scope
LL | fn f<T:SomeNonExistentTrait>() {}
| ^^^^^^^^^^^^^^^^^^^^ 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 3 previous errors
error: aborting due to 4 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`.

View File

@ -32,3 +32,5 @@ mod a {
}
}
}
fn main() {}

View File

@ -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 4 previous errors
error: aborting due to 5 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`.

View File

@ -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() {}

View File

@ -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`.

View File

@ -15,3 +15,5 @@ mod foo {
//~^ ERROR expected one of `)` or `,`, found `(`
//~| ERROR cannot find type `foo` in this scope
}
fn main() {}

View File

@ -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 2 previous errors
error: aborting due to 3 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`.

View File

@ -55,3 +55,5 @@ mod items {
fn item() {}
}
fn main() {}

View File

@ -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 6 previous errors
error: aborting due to 7 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`.

View File

@ -11,3 +11,5 @@
#![allow(unused_macros)]
macro_rules! macro_rules { () => {} } //~ ERROR user-defined macros may not be named `macro_rules`
fn main() {}

View File

@ -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 previous error
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0601`.

View File

@ -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() {}

View File

@ -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`.