Skip to content

Commit 9d80c65

Browse files
authored
Rollup merge of rust-lang#53622 - petrochenkov:nomain, r=oli-obk
cleanup: Add main functions to some UI tests
2 parents e6381a7 + c56adf6 commit 9d80c65

Some content is hidden

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

48 files changed

+91
-165
lines changed

src/test/ui/enum/enum-discrim-autosizing.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ enum Eu64 {
1818
Bu64 = 0x8000_0000_0000_0000 //~ERROR already exists
1919
}
2020

21+
fn main() {}
Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
error[E0601]: `main` function not found in crate `enum_discrim_autosizing`
2-
|
3-
= note: consider adding a `main` function to `$DIR/enum-discrim-autosizing.rs`
4-
51
error[E0081]: discriminant value `0` already exists
62
--> $DIR/enum-discrim-autosizing.rs:18:12
73
|
@@ -10,7 +6,6 @@ LL | Au64 = 0,
106
LL | Bu64 = 0x8000_0000_0000_0000 //~ERROR already exists
117
| ^^^^^^^^^^^^^^^^^^^^^ enum already has `0`
128

13-
error: aborting due to 2 previous errors
9+
error: aborting due to previous error
1410

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

src/test/ui/gated-bad-feature.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,5 @@
2020
#![feature = "foo"] //~ ERROR: malformed feature
2121

2222
#![feature(test_removed_feature)] //~ ERROR: feature has been removed
23+
24+
fn main() {}

src/test/ui/gated-bad-feature.stderr

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,7 @@ error[E0557]: feature has been removed
2828
LL | #![feature(test_removed_feature)] //~ ERROR: feature has been removed
2929
| ^^^^^^^^^^^^^^^^^^^^
3030

31-
error[E0601]: `main` function not found in crate `gated_bad_feature`
32-
|
33-
= note: consider adding a `main` function to `$DIR/gated-bad-feature.rs`
34-
35-
error: aborting due to 6 previous errors
31+
error: aborting due to 5 previous errors
3632

37-
Some errors occurred: E0555, E0556, E0557, E0601.
33+
Some errors occurred: E0555, E0556, E0557.
3834
For more information about an error, try `rustc --explain E0555`.

src/test/ui/hygiene/generate-mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,5 @@ fn check_legacy() {
5555
struct FromOutside;
5656
genmod_legacy!();
5757
}
58+
59+
fn main() {}

src/test/ui/hygiene/generate-mod.stderr

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,6 @@ LL | type Inner = Outer; //~ ERROR cannot find type `Outer` in this scop
4646
LL | genmod_legacy!();
4747
| ----------------- in this macro invocation
4848

49-
error[E0601]: `main` function not found in crate `generate_mod`
50-
|
51-
= note: consider adding a `main` function to `$DIR/generate-mod.rs`
52-
53-
error: aborting due to 7 previous errors
49+
error: aborting due to 6 previous errors
5450

55-
Some errors occurred: E0412, E0601.
56-
For more information about an error, try `rustc --explain E0412`.
51+
For more information about this error, try `rustc --explain E0412`.

src/test/ui/hygiene/no_implicit_prelude.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,5 @@ mod bar {
2323
}
2424
fn f() { ::foo::m!(); }
2525
}
26+
27+
fn main() {}

src/test/ui/hygiene/no_implicit_prelude.stderr

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ LL | fn f() { ::bar::m!(); }
77
LL | Vec::new(); //~ ERROR failed to resolve
88
| ^^^ Use of undeclared type or module `Vec`
99

10-
error[E0601]: `main` function not found in crate `no_implicit_prelude`
11-
|
12-
= note: consider adding a `main` function to `$DIR/no_implicit_prelude.rs`
13-
1410
error[E0599]: no method named `clone` found for type `()` in the current scope
1511
--> $DIR/no_implicit_prelude.rs:22:12
1612
|
@@ -24,7 +20,7 @@ LL | ().clone() //~ ERROR no method named `clone` found
2420
= note: the following trait is implemented but not in scope, perhaps add a `use` for it:
2521
`use std::clone::Clone;`
2622

27-
error: aborting due to 3 previous errors
23+
error: aborting due to 2 previous errors
2824

29-
Some errors occurred: E0433, E0599, E0601.
25+
Some errors occurred: E0433, E0599.
3026
For more information about an error, try `rustc --explain E0433`.

src/test/ui/imports/import-glob-circular.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,5 @@ mod test {
2525

2626
fn test() { f1066(); } //~ ERROR cannot find function `f1066` in this scope
2727
}
28+
29+
fn main() {}

src/test/ui/imports/import-glob-circular.stderr

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,6 @@ error[E0425]: cannot find function `f1066` in this scope
44
LL | fn test() { f1066(); } //~ ERROR cannot find function `f1066` in this scope
55
| ^^^^^ not found in this scope
66

7-
error[E0601]: `main` function not found in crate `import_glob_circular`
8-
|
9-
= note: consider adding a `main` function to `$DIR/import-glob-circular.rs`
10-
11-
error: aborting due to 2 previous errors
7+
error: aborting due to previous error
128

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

0 commit comments

Comments
 (0)