Skip to content

Commit a56bf51

Browse files
committed
Make some use _ tests multi-edition
1 parent 9c4ff56 commit a56bf51

6 files changed

+104
-13
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
error: expected identifier, found reserved identifier `_`
2+
--> $DIR/multiple-extern-by-macro-for-underscore.rs:18:11
3+
|
4+
LL | use ::_;
5+
| ^ expected identifier, found reserved identifier
6+
7+
error[E0432]: unresolved import `_`
8+
--> $DIR/multiple-extern-by-macro-for-underscore.rs:18:9
9+
|
10+
LL | use ::_;
11+
| ^^^ no `_` in the root
12+
13+
error: aborting due to 2 previous errors
14+
15+
For more information about this error, try `rustc --explain E0432`.

tests/ui/imports/multiple-extern-by-macro-for-underscore.stderr renamed to tests/ui/imports/multiple-extern-by-macro-for-underscore.ed2021.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: expected identifier, found reserved identifier `_`
2-
--> $DIR/multiple-extern-by-macro-for-underscore.rs:16:11
2+
--> $DIR/multiple-extern-by-macro-for-underscore.rs:18:11
33
|
44
LL | use ::_;
55
| ^ expected identifier, found reserved identifier

tests/ui/imports/multiple-extern-by-macro-for-underscore.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
//@ edition: 2021
1+
//@ revisions: ed2015 ed2021
2+
//@[ed2015] edition: 2015
3+
//@[ed2021] edition: 2021
24

35
// issue#128813
46

@@ -13,6 +15,6 @@ macro_rules! m {
1315
m!();
1416

1517
fn main() {
16-
use ::_;
18+
use ::_; //[ed2015]~ ERROR: unresolved import `_`
1719
//~^ ERROR: expected identifier, found reserved identifier `_`
1820
}

tests/ui/underscore-imports/issue-110164.stderr renamed to tests/ui/underscore-imports/issue-110164.ed2015.stderr

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,59 @@
11
error: expected identifier, found reserved identifier `_`
2-
--> $DIR/issue-110164.rs:5:5
2+
--> $DIR/issue-110164.rs:8:5
33
|
44
LL | use _::a;
55
| ^ expected identifier, found reserved identifier
66

77
error: expected identifier, found reserved identifier `_`
8-
--> $DIR/issue-110164.rs:8:5
8+
--> $DIR/issue-110164.rs:11:5
99
|
1010
LL | use _::*;
1111
| ^ expected identifier, found reserved identifier
1212

1313
error: expected identifier, found reserved identifier `_`
14-
--> $DIR/issue-110164.rs:13:9
14+
--> $DIR/issue-110164.rs:16:9
1515
|
1616
LL | use _::a;
1717
| ^ expected identifier, found reserved identifier
1818

1919
error: expected identifier, found reserved identifier `_`
20-
--> $DIR/issue-110164.rs:16:9
20+
--> $DIR/issue-110164.rs:19:9
2121
|
2222
LL | use _::*;
2323
| ^ expected identifier, found reserved identifier
2424

2525
error[E0432]: unresolved import `self::*`
26-
--> $DIR/issue-110164.rs:1:5
26+
--> $DIR/issue-110164.rs:4:5
2727
|
2828
LL | use self::*;
2929
| ^^^^^^^ cannot glob-import a module into itself
3030

3131
error[E0432]: unresolved import `crate::*`
32-
--> $DIR/issue-110164.rs:3:5
32+
--> $DIR/issue-110164.rs:6:5
3333
|
3434
LL | use crate::*;
3535
| ^^^^^^^^ cannot glob-import a module into itself
3636

3737
error[E0432]: unresolved import `_`
38-
--> $DIR/issue-110164.rs:8:5
38+
--> $DIR/issue-110164.rs:11:5
3939
|
4040
LL | use _::*;
4141
| ^ `_` is not a valid crate or module name
4242

4343
error[E0432]: unresolved import `_`
44-
--> $DIR/issue-110164.rs:5:5
44+
--> $DIR/issue-110164.rs:8:5
4545
|
4646
LL | use _::a;
4747
| ^ `_` is not a valid crate or module name
4848

4949
error[E0432]: unresolved import `_`
50-
--> $DIR/issue-110164.rs:13:9
50+
--> $DIR/issue-110164.rs:16:9
5151
|
5252
LL | use _::a;
5353
| ^ `_` is not a valid crate or module name
5454

5555
error[E0432]: unresolved import `_`
56-
--> $DIR/issue-110164.rs:16:9
56+
--> $DIR/issue-110164.rs:19:9
5757
|
5858
LL | use _::*;
5959
| ^ `_` is not a valid crate or module name
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
error: expected identifier, found reserved identifier `_`
2+
--> $DIR/issue-110164.rs:8:5
3+
|
4+
LL | use _::a;
5+
| ^ expected identifier, found reserved identifier
6+
7+
error: expected identifier, found reserved identifier `_`
8+
--> $DIR/issue-110164.rs:11:5
9+
|
10+
LL | use _::*;
11+
| ^ expected identifier, found reserved identifier
12+
13+
error: expected identifier, found reserved identifier `_`
14+
--> $DIR/issue-110164.rs:16:9
15+
|
16+
LL | use _::a;
17+
| ^ expected identifier, found reserved identifier
18+
19+
error: expected identifier, found reserved identifier `_`
20+
--> $DIR/issue-110164.rs:19:9
21+
|
22+
LL | use _::*;
23+
| ^ expected identifier, found reserved identifier
24+
25+
error[E0432]: unresolved import `self::*`
26+
--> $DIR/issue-110164.rs:4:5
27+
|
28+
LL | use self::*;
29+
| ^^^^^^^ cannot glob-import a module into itself
30+
31+
error[E0432]: unresolved import `crate::*`
32+
--> $DIR/issue-110164.rs:6:5
33+
|
34+
LL | use crate::*;
35+
| ^^^^^^^^ cannot glob-import a module into itself
36+
37+
error[E0432]: unresolved import `_`
38+
--> $DIR/issue-110164.rs:11:5
39+
|
40+
LL | use _::*;
41+
| ^ use of unresolved module or unlinked crate `_`
42+
|
43+
= help: you might be missing a crate named `_`
44+
45+
error[E0432]: unresolved import `_`
46+
--> $DIR/issue-110164.rs:8:5
47+
|
48+
LL | use _::a;
49+
| ^ use of unresolved module or unlinked crate `_`
50+
|
51+
= help: you might be missing a crate named `_`
52+
53+
error[E0432]: unresolved import `_`
54+
--> $DIR/issue-110164.rs:16:9
55+
|
56+
LL | use _::a;
57+
| ^ use of unresolved module or unlinked crate `_`
58+
|
59+
= help: you might be missing a crate named `_`
60+
61+
error[E0432]: unresolved import `_`
62+
--> $DIR/issue-110164.rs:19:9
63+
|
64+
LL | use _::*;
65+
| ^ use of unresolved module or unlinked crate `_`
66+
|
67+
= help: you might be missing a crate named `_`
68+
69+
error: aborting due to 10 previous errors
70+
71+
For more information about this error, try `rustc --explain E0432`.

tests/ui/underscore-imports/issue-110164.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
//@ revisions: ed2015 ed2021
2+
//@[ed2015] edition: 2015
3+
//@[ed2021] edition: 2021
14
use self::*;
25
//~^ ERROR unresolved import `self::*`
36
use crate::*;

0 commit comments

Comments
 (0)