Skip to content

Commit 6aa4dcb

Browse files
committed
Add empty main() to tests where it is missing.
1 parent b4b7ccb commit 6aa4dcb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+75
-95
lines changed

src/test/ui/error-codes/E0522.rs

+2
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,5 @@ fn cookie() -> ! {
1515
//~^^ ERROR definition of an unknown language item: `cookie` [E0522]
1616
loop {}
1717
}
18+
19+
fn main() {}

src/test/ui/error-codes/E0522.stderr

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
1-
error[E0601]: main function not found in crate E0522
2-
31
error[E0522]: definition of an unknown language item: `cookie`
42
--> $DIR/E0522.rs:13:1
53
|
64
LL | #[lang = "cookie"]
75
| ^^^^^^^^^^^^^^^^^^ definition of unknown language item `cookie`
86

9-
error: aborting due to 2 previous errors
7+
error: aborting due to previous error
108

11-
Some errors occurred: E0522, E0601.
12-
For more information about an error, try `rustc --explain E0522`.
9+
For more information about this error, try `rustc --explain E0522`.

src/test/ui/feature-gate-i128_type2.rs

+2
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,5 @@ fn test3_2() {
3030
enum A { //~ ERROR 128-bit type is unstable
3131
A(u64)
3232
}
33+
34+
fn main() {}

src/test/ui/feature-gate-i128_type2.stderr

+2-5
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ LL | let x: u128 = 0; //~ ERROR 128-bit type is unstable
3030
|
3131
= help: add #![feature(i128_type)] to the crate attributes to enable
3232

33-
error[E0601]: main function not found in crate feature_gate_i128_type2
34-
3533
error[E0658]: repr with 128-bit type is unstable (see issue #35118)
3634
--> $DIR/feature-gate-i128_type2.rs:30:1
3735
|
@@ -42,7 +40,6 @@ LL | | }
4240
|
4341
= help: add #![feature(repr128)] to the crate attributes to enable
4442

45-
error: aborting due to 6 previous errors
43+
error: aborting due to 5 previous errors
4644

47-
Some errors occurred: E0601, E0658.
48-
For more information about an error, try `rustc --explain E0601`.
45+
For more information about this error, try `rustc --explain E0658`.

src/test/ui/feature-gate/issue-43106-gating-of-inline.rs

+2
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,5 @@ mod inline {
3535
#[inline = "2100"] impl S { }
3636
//~^ ERROR attribute should be applied to function
3737
}
38+
39+
fn main() {}

src/test/ui/feature-gate/issue-43106-gating-of-inline.stderr

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
error[E0601]: main function not found in crate issue_43106_gating_of_inline
2-
31
error[E0518]: attribute should be applied to function
42
--> $DIR/issue-43106-gating-of-inline.rs:21:1
53
|
@@ -39,7 +37,6 @@ error[E0518]: attribute should be applied to function
3937
LL | #[inline = "2100"] impl S { }
4038
| ^^^^^^^^^^^^^^^^^^ ---------- not a function
4139

42-
error: aborting due to 6 previous errors
40+
error: aborting due to 5 previous errors
4341

44-
Some errors occurred: E0518, E0601.
45-
For more information about an error, try `rustc --explain E0518`.
42+
For more information about this error, try `rustc --explain E0518`.

src/test/ui/feature-gate/issue-43106-gating-of-macro_escape.rs

+4
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,9 @@
1313
// `#![macro_escape]` is incompatible with crate-level `#![macro_use]`
1414
// already present in issue-43106-gating-of-builtin-attrs.
1515

16+
// must-compile-successfully
17+
1618
#![macro_escape]
1719
//~^ WARN macro_escape is a deprecated synonym for macro_use
20+
21+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
warning: macro_escape is a deprecated synonym for macro_use
2-
--> $DIR/issue-43106-gating-of-macro_escape.rs:16:1
2+
--> $DIR/issue-43106-gating-of-macro_escape.rs:18:1
33
|
44
LL | #![macro_escape]
55
| ^^^^^^^^^^^^^^^^
66
|
77
= help: consider an outer attribute, #[macro_use] mod ...
88

9-
error[E0601]: main function not found in crate issue_43106_gating_of_macro_escape
10-
11-
error: aborting due to previous error
12-
13-
For more information about this error, try `rustc --explain E0601`.

src/test/ui/feature-gate/issue-43106-gating-of-proc_macro_derive.rs

+2
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,5 @@ mod proc_macro_derive2 {
4040
#[proc_macro_derive = "2500"] impl S { }
4141
//~^ ERROR the `#[proc_macro_derive]` attribute may only be used on bare functions
4242
}
43+
44+
fn main() {}

src/test/ui/feature-gate/issue-43106-gating-of-proc_macro_derive.stderr

+1-4
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,5 @@ error: the `#[proc_macro_derive]` attribute may only be used on bare functions
3434
LL | #[proc_macro_derive = "2500"] impl S { }
3535
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3636

37-
error[E0601]: main function not found in crate issue_43106_gating_of_proc_macro_derive
37+
error: aborting due to 6 previous errors
3838

39-
error: aborting due to 7 previous errors
40-
41-
For more information about this error, try `rustc --explain E0601`.

src/test/ui/feature-gate/issue-43106-gating-of-rustc_deprecated.rs

+1
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,4 @@ mod rustc_deprecated {
3636
//~^ ERROR stability attributes may not be used outside of the standard library
3737
}
3838

39+
fn main() {}

src/test/ui/feature-gate/issue-43106-gating-of-rustc_deprecated.stderr

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
error[E0601]: main function not found in crate issue_43106_gating_of_rustc_deprecated
2-
31
error: stability attributes may not be used outside of the standard library
42
--> $DIR/issue-43106-gating-of-rustc_deprecated.rs:17:1
53
|
@@ -42,6 +40,5 @@ error: stability attributes may not be used outside of the standard library
4240
LL | #[rustc_deprecated = "1500"] impl S { }
4341
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4442

45-
error: aborting due to 8 previous errors
43+
error: aborting due to 7 previous errors
4644

47-
For more information about this error, try `rustc --explain E0601`.

src/test/ui/feature-gate/issue-43106-gating-of-stable.rs

+2
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,5 @@ mod stable {
3535
#[stable = "1300"] impl S { }
3636
//~^ ERROR stability attributes may not be used outside of the standard library
3737
}
38+
39+
fn main() {}

src/test/ui/feature-gate/issue-43106-gating-of-stable.stderr

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
error[E0601]: main function not found in crate issue_43106_gating_of_stable
2-
31
error: stability attributes may not be used outside of the standard library
42
--> $DIR/issue-43106-gating-of-stable.rs:17:1
53
|
@@ -42,6 +40,5 @@ error: stability attributes may not be used outside of the standard library
4240
LL | #[stable = "1300"] impl S { }
4341
| ^^^^^^^^^^^^^^^^^^
4442

45-
error: aborting due to 8 previous errors
43+
error: aborting due to 7 previous errors
4644

47-
For more information about this error, try `rustc --explain E0601`.

src/test/ui/feature-gate/issue-43106-gating-of-unstable.rs

+2
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,5 @@ mod unstable {
3535
#[unstable = "1200"] impl S { }
3636
//~^ ERROR stability attributes may not be used outside of the standard library
3737
}
38+
39+
fn main() {}

src/test/ui/feature-gate/issue-43106-gating-of-unstable.stderr

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
error[E0601]: main function not found in crate issue_43106_gating_of_unstable
2-
31
error: stability attributes may not be used outside of the standard library
42
--> $DIR/issue-43106-gating-of-unstable.rs:17:1
53
|
@@ -42,6 +40,5 @@ error: stability attributes may not be used outside of the standard library
4240
LL | #[unstable = "1200"] impl S { }
4341
| ^^^^^^^^^^^^^^^^^^^^
4442

45-
error: aborting due to 8 previous errors
43+
error: aborting due to 7 previous errors
4644

47-
For more information about this error, try `rustc --explain E0601`.

src/test/ui/generator/yield-in-const.rs

+2
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,5 @@
1212

1313
const A: u8 = { yield 3u8; 3u8};
1414
//~^ ERROR yield statement outside
15+
16+
fn main() {}
+2-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
1-
error[E0601]: main function not found in crate yield_in_const
2-
31
error[E0627]: yield statement outside of generator literal
42
--> $DIR/yield-in-const.rs:13:17
53
|
64
LL | const A: u8 = { yield 3u8; 3u8};
75
| ^^^^^^^^^
86

9-
error: aborting due to 2 previous errors
7+
error: aborting due to previous error
108

11-
Some errors occurred: E0601, E0627.
12-
For more information about an error, try `rustc --explain E0601`.
9+
For more information about this error, try `rustc --explain E0627`.

src/test/ui/generator/yield-in-static.rs

+2
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,5 @@
1212

1313
static B: u8 = { yield 3u8; 3u8};
1414
//~^ ERROR yield statement outside
15+
16+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
1-
error[E0601]: main function not found in crate yield_in_static
2-
31
error[E0627]: yield statement outside of generator literal
42
--> $DIR/yield-in-static.rs:13:18
53
|
64
LL | static B: u8 = { yield 3u8; 3u8};
75
| ^^^^^^^^^
86

9-
error: aborting due to 2 previous errors
7+
error: aborting due to previous error
108

11-
Some errors occurred: E0601, E0627.
12-
For more information about an error, try `rustc --explain E0601`.
9+
For more information about this error, try `rustc --explain E0627`.

src/test/ui/imports/macro-paths.rs

+2
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,5 @@ fn g() {
3636
mod baz { pub use two_macros::m; }
3737
}
3838
}
39+
40+
fn main() {}

src/test/ui/imports/macro-paths.stderr

+2-5
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@ LL | | }
3636
| |_^
3737
= note: macro-expanded items do not shadow when used in a macro invocation path
3838

39-
error[E0601]: main function not found in crate macro_paths
39+
error: aborting due to 2 previous errors
4040

41-
error: aborting due to 3 previous errors
42-
43-
Some errors occurred: E0601, E0659.
44-
For more information about an error, try `rustc --explain E0601`.
41+
For more information about this error, try `rustc --explain E0659`.

src/test/ui/imports/macros.rs

+2
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,5 @@ mod m4 {
4949
use two_macros::m;
5050
m!(); //~ ERROR ambiguous
5151
}
52+
53+
fn main() {}

src/test/ui/imports/macros.stderr

+2-5
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,6 @@ LL | use two_macros::m;
5151
| ^^^^^^^^^^^^^
5252
= note: macro-expanded macro imports do not shadow
5353

54-
error[E0601]: main function not found in crate macros
54+
error: aborting due to 3 previous errors
5555

56-
error: aborting due to 4 previous errors
57-
58-
Some errors occurred: E0601, E0659.
59-
For more information about an error, try `rustc --explain E0601`.
56+
For more information about this error, try `rustc --explain E0659`.

src/test/ui/in-band-lifetimes/mismatched_trait_impl-2.rs

+2
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,5 @@ impl Deref for Struct {
2020
}
2121
}
2222
//~^^^^ ERROR cannot infer an appropriate lifetime for lifetime parameter
23+
24+
fn main() {}

src/test/ui/in-band-lifetimes/mismatched_trait_impl-2.stderr

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
error[E0601]: main function not found in crate mismatched_trait_impl_2
2-
31
error[E0495]: cannot infer an appropriate lifetime for lifetime parameter in generic type due to conflicting requirements
42
--> $DIR/mismatched_trait_impl-2.rs:18:5
53
|
@@ -18,7 +16,6 @@ LL | | }
1816
expected fn(&Struct) -> &Trait + 'static
1917
found fn(&Struct) -> &Trait
2018

21-
error: aborting due to 2 previous errors
19+
error: aborting due to previous error
2220

23-
Some errors occurred: E0495, E0601.
24-
For more information about an error, try `rustc --explain E0495`.
21+
For more information about this error, try `rustc --explain E0495`.

src/test/ui/issue-47706-trait.rs

+2
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,5 @@ trait T {
1414
}
1515
//~^^ ERROR function is expected to take a single 0-tuple as argument
1616
}
17+
18+
fn main() {}

src/test/ui/issue-47706-trait.stderr

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
error[E0601]: main function not found in crate issue_47706_trait
2-
31
error[E0593]: function is expected to take a single 0-tuple as argument, but it takes 2 distinct arguments
42
--> $DIR/issue-47706-trait.rs:13:20
53
|
@@ -8,7 +6,6 @@ LL | fn f(&self, _: ()) {
86
LL | None::<()>.map(Self::f);
97
| ^^^ expected function that takes a single 0-tuple as argument
108

11-
error: aborting due to 2 previous errors
9+
error: aborting due to previous error
1210

13-
Some errors occurred: E0593, E0601.
14-
For more information about an error, try `rustc --explain E0593`.
11+
For more information about this error, try `rustc --explain E0593`.

src/test/ui/missing-items/m2.rs

+2
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,5 @@ struct X {
1818

1919
impl m1::X for X { //~ ERROR not all trait items implemented
2020
}
21+
22+
fn main() {}

src/test/ui/missing-items/m2.stderr

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
error[E0601]: main function not found in crate m2
2-
31
error[E0046]: not all trait items implemented, missing: `CONSTANT`, `Type`, `method`
42
--> $DIR/m2.rs:19:1
53
|
@@ -10,7 +8,6 @@ LL | impl m1::X for X { //~ ERROR not all trait items implemented
108
= note: `Type` from trait: `type Type;`
119
= note: `method` from trait: `fn(&Self, std::string::String) -> <Self as m1::X>::Type`
1210

13-
error: aborting due to 2 previous errors
11+
error: aborting due to previous error
1412

15-
Some errors occurred: E0046, E0601.
16-
For more information about an error, try `rustc --explain E0046`.
13+
For more information about this error, try `rustc --explain E0046`.

src/test/ui/resolve/issue-14254.rs

+2
Original file line numberDiff line numberDiff line change
@@ -111,3 +111,5 @@ impl Foo for Box<isize> {
111111
//~^ ERROR cannot find value `bah`
112112
}
113113
}
114+
115+
fn main() {}

src/test/ui/resolve/issue-14254.stderr

+2-5
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,6 @@ error[E0425]: cannot find value `bah` in this scope
142142
LL | bah;
143143
| ^^^ help: try: `Self::bah`
144144

145-
error[E0601]: main function not found in crate issue_14254
145+
error: aborting due to 24 previous errors
146146

147-
error: aborting due to 25 previous errors
148-
149-
Some errors occurred: E0425, E0601.
150-
For more information about an error, try `rustc --explain E0425`.
147+
For more information about this error, try `rustc --explain E0425`.

src/test/ui/resolve/issue-21221-2.rs

+2
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,5 @@ pub mod baz {
2727
struct Foo;
2828
impl T for Foo { }
2929
//~^ ERROR cannot find trait `T`
30+
31+
fn main() {}

src/test/ui/resolve/issue-21221-2.stderr

-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,5 @@ help: possible candidate is found in another module, you can import it into scop
88
LL | use foo::bar::T;
99
|
1010

11-
error[E0601]: main function not found in crate issue_21221_2
12-
1311
error: cannot continue compilation due to previous error
1412

src/test/ui/resolve/suggest-path-instead-of-mod-dot-item.rs

+2
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,5 @@ fn h8() -> i32 {
6565
a::b()
6666
//~^ ERROR expected function, found module `a::b`
6767
}
68+
69+
fn main() {}

src/test/ui/resolve/suggest-path-instead-of-mod-dot-item.stderr

+2-5
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,6 @@ LL | a::b()
7272
| |
7373
| did you mean `I`?
7474

75-
error[E0601]: main function not found in crate suggest_path_instead_of_mod_dot_item
75+
error: aborting due to 9 previous errors
7676

77-
error: aborting due to 10 previous errors
78-
79-
Some errors occurred: E0423, E0601.
80-
For more information about an error, try `rustc --explain E0423`.
77+
For more information about this error, try `rustc --explain E0423`.

src/test/ui/span/issue-35987.rs

+2
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,5 @@ impl<T: Clone, Add> Add for Foo<T> {
2020
unimplemented!();
2121
}
2222
}
23+
24+
fn main() {}

src/test/ui/span/issue-35987.stderr

-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,5 @@ help: possible better candidate is found in another module, you can import it in
88
LL | use std::ops::Add;
99
|
1010

11-
error[E0601]: main function not found in crate issue_35987
12-
1311
error: cannot continue compilation due to previous error
1412

src/test/ui/token/issue-10636-2.rs

+2
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,5 @@ pub fn trace_option(option: Option<isize>) {
1717

1818
} //~ ERROR: incorrect close delimiter
1919
//~^ ERROR: expected expression, found `)`
20+
21+
fn main() {}

src/test/ui/token/issue-10636-2.stderr

+1-4
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,5 @@ error: expected expression, found `)`
2222
LL | } //~ ERROR: incorrect close delimiter
2323
| ^ expected expression
2424

25-
error[E0601]: main function not found in crate issue_10636_2
25+
error: aborting due to 3 previous errors
2626

27-
error: aborting due to 4 previous errors
28-
29-
For more information about this error, try `rustc --explain E0601`.

src/test/ui/token/issue-41155.rs

+2
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,5 @@
1111
impl S { //~ ERROR cannot find type
1212
pub
1313
} //~ ERROR expected one of
14+
15+
fn main() {}

0 commit comments

Comments
 (0)