Skip to content

Commit 9680ee6

Browse files
Update uitest stderrs
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
1 parent 6a22cf7 commit 9680ee6

27 files changed

+263
-74
lines changed

compiler/rustc_error_codes/src/error_codes/E0466.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
#### Note: this error code is no longer emitted by the compiler.
2+
13
Macro import declaration was malformed.
24

35
Erroneous code examples:
46

5-
```compile_fail,E0466
7+
```compile_fail
68
#[macro_use(a_macro(another_macro))] // error: invalid import declaration
79
extern crate core as some_crate;
810
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#![deny(unused_attributes)]
2+
//~^ NOTE the lint level is defined here
3+
4+
#[macro_use = 5]
5+
//~^ ERROR valid forms for the attribute are `#[macro_use(name1, name2, ...)]` and `#[macro_use]`
6+
extern crate std as s1;
7+
8+
#[macro_use(5)]
9+
//~^ ERROR malformed `macro_use` attribute input
10+
//~| NOTE expected a valid identifier here
11+
extern crate std as s2;
12+
13+
#[macro_use(a = "b")]
14+
//~^ ERROR malformed `macro_use` attribute input
15+
//~| NOTE didn't expect any arguments here
16+
extern crate std as s3;
17+
18+
#[macro_use(a(b))]
19+
//~^ ERROR malformed `macro_use` attribute input
20+
//~| NOTE didn't expect any arguments here
21+
extern crate std as s4;
22+
23+
#[macro_use(a::b)]
24+
//~^ ERROR malformed `macro_use` attribute input
25+
//~| NOTE expected a valid identifier here
26+
extern crate std as s5;
27+
28+
#[macro_use(a)]
29+
//~^ ERROR unused attribute
30+
#[macro_use]
31+
//~^ NOTE attribute also specified here
32+
extern crate std as s6;
33+
34+
#[macro_use]
35+
//~^ NOTE attribute also specified here
36+
#[macro_use(a)]
37+
//~^ ERROR unused attribute
38+
extern crate std as s7;
39+
40+
#[macro_use]
41+
//~^ NOTE attribute also specified here
42+
#[macro_use]
43+
//~^ ERROR unused attribute
44+
extern crate std as s8;
45+
46+
// This is fine, both are importing different names
47+
#[macro_use(a)]
48+
//~^ ERROR imported macro not found
49+
#[macro_use(b)]
50+
//~^ ERROR imported macro not found
51+
extern crate std as s9;
52+
53+
fn main() {}
Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
error[E0469]: imported macro not found
2+
--> $DIR/invalid-macro-use.rs:47:13
3+
|
4+
LL | #[macro_use(a)]
5+
| ^
6+
7+
error[E0469]: imported macro not found
8+
--> $DIR/invalid-macro-use.rs:49:13
9+
|
10+
LL | #[macro_use(b)]
11+
| ^
12+
13+
error: valid forms for the attribute are `#[macro_use(name1, name2, ...)]` and `#[macro_use]`
14+
--> $DIR/invalid-macro-use.rs:4:1
15+
|
16+
LL | #[macro_use = 5]
17+
| ^^^^^^^^^^^^^^^^
18+
19+
error[E0539]: malformed `macro_use` attribute input
20+
--> $DIR/invalid-macro-use.rs:8:1
21+
|
22+
LL | #[macro_use(5)]
23+
| ^^^^^^^^^^^^-^^
24+
| |
25+
| expected a valid identifier here
26+
|
27+
help: try changing it to one of the following valid forms of the attribute
28+
|
29+
LL - #[macro_use(5)]
30+
LL + #[macro_use(name1, name2, ...)]
31+
|
32+
LL - #[macro_use(5)]
33+
LL + #[macro_use]
34+
|
35+
36+
error[E0565]: malformed `macro_use` attribute input
37+
--> $DIR/invalid-macro-use.rs:13:1
38+
|
39+
LL | #[macro_use(a = "b")]
40+
| ^^^^^^^^^^^^^^-----^^
41+
| |
42+
| didn't expect any arguments here
43+
|
44+
help: try changing it to one of the following valid forms of the attribute
45+
|
46+
LL - #[macro_use(a = "b")]
47+
LL + #[macro_use(name1, name2, ...)]
48+
|
49+
LL - #[macro_use(a = "b")]
50+
LL + #[macro_use]
51+
|
52+
53+
error[E0565]: malformed `macro_use` attribute input
54+
--> $DIR/invalid-macro-use.rs:18:1
55+
|
56+
LL | #[macro_use(a(b))]
57+
| ^^^^^^^^^^^^^---^^
58+
| |
59+
| didn't expect any arguments here
60+
|
61+
help: try changing it to one of the following valid forms of the attribute
62+
|
63+
LL - #[macro_use(a(b))]
64+
LL + #[macro_use(name1, name2, ...)]
65+
|
66+
LL - #[macro_use(a(b))]
67+
LL + #[macro_use]
68+
|
69+
70+
error[E0539]: malformed `macro_use` attribute input
71+
--> $DIR/invalid-macro-use.rs:23:1
72+
|
73+
LL | #[macro_use(a::b)]
74+
| ^^^^^^^^^^^^----^^
75+
| |
76+
| expected a valid identifier here
77+
|
78+
help: try changing it to one of the following valid forms of the attribute
79+
|
80+
LL - #[macro_use(a::b)]
81+
LL + #[macro_use(name1, name2, ...)]
82+
|
83+
LL - #[macro_use(a::b)]
84+
LL + #[macro_use]
85+
|
86+
87+
error: unused attribute
88+
--> $DIR/invalid-macro-use.rs:28:1
89+
|
90+
LL | #[macro_use(a)]
91+
| ^^^^^^^^^^^^^^^ help: remove this attribute
92+
|
93+
note: attribute also specified here
94+
--> $DIR/invalid-macro-use.rs:30:1
95+
|
96+
LL | #[macro_use]
97+
| ^^^^^^^^^^^^
98+
note: the lint level is defined here
99+
--> $DIR/invalid-macro-use.rs:1:9
100+
|
101+
LL | #![deny(unused_attributes)]
102+
| ^^^^^^^^^^^^^^^^^
103+
104+
error: unused attribute
105+
--> $DIR/invalid-macro-use.rs:36:1
106+
|
107+
LL | #[macro_use(a)]
108+
| ^^^^^^^^^^^^^^^ help: remove this attribute
109+
|
110+
note: attribute also specified here
111+
--> $DIR/invalid-macro-use.rs:34:1
112+
|
113+
LL | #[macro_use]
114+
| ^^^^^^^^^^^^
115+
116+
error: unused attribute
117+
--> $DIR/invalid-macro-use.rs:42:1
118+
|
119+
LL | #[macro_use]
120+
| ^^^^^^^^^^^^ help: remove this attribute
121+
|
122+
note: attribute also specified here
123+
--> $DIR/invalid-macro-use.rs:40:1
124+
|
125+
LL | #[macro_use]
126+
| ^^^^^^^^^^^^
127+
128+
error: aborting due to 10 previous errors
129+
130+
Some errors have detailed explanations: E0469, E0539, E0565.
131+
For more information about an error, try `rustc --explain E0469`.

tests/ui/attributes/malformed-attrs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ static mut TLS: u8 = 42;
207207
#[no_link()]
208208
//~^ ERROR malformed
209209
#[macro_use = 1]
210-
//~^ ERROR malformed
210+
//~^ ERROR valid forms for the attribute are `#[macro_use(name1, name2, ...)]` and `#[macro_use]`
211211
extern crate wloop;
212212
//~^ ERROR can't find crate for `wloop` [E0463]
213213

tests/ui/attributes/malformed-attrs.stderr

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -182,21 +182,6 @@ error: malformed `no_link` attribute input
182182
LL | #[no_link()]
183183
| ^^^^^^^^^^^^ help: must be of the form: `#[no_link]`
184184

185-
error: malformed `macro_use` attribute input
186-
--> $DIR/malformed-attrs.rs:209:1
187-
|
188-
LL | #[macro_use = 1]
189-
| ^^^^^^^^^^^^^^^^
190-
|
191-
help: the following are the possible correct uses
192-
|
193-
LL - #[macro_use = 1]
194-
LL + #[macro_use(name1, name2, ...)]
195-
|
196-
LL - #[macro_use = 1]
197-
LL + #[macro_use]
198-
|
199-
200185
error: malformed `macro_export` attribute input
201186
--> $DIR/malformed-attrs.rs:214:1
202187
|
@@ -555,6 +540,12 @@ LL | #[non_exhaustive = 1]
555540
| | didn't expect any arguments here
556541
| help: must be of the form: `#[non_exhaustive]`
557542

543+
error: valid forms for the attribute are `#[macro_use(name1, name2, ...)]` and `#[macro_use]`
544+
--> $DIR/malformed-attrs.rs:209:1
545+
|
546+
LL | #[macro_use = 1]
547+
| ^^^^^^^^^^^^^^^^
548+
558549
error[E0565]: malformed `type_const` attribute input
559550
--> $DIR/malformed-attrs.rs:143:5
560551
|

tests/ui/feature-gates/issue-43106-gating-of-macro_use.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ mod macro_escape {
1313
//~^ ERROR arguments to `macro_use` are not allowed here
1414

1515
#[macro_use = "2700"] struct S;
16-
//~^ ERROR malformed `macro_use` attribute
16+
//~^ ERROR valid forms for the attribute are `#[macro_use(name1, name2, ...)]` and `#[macro_use]`
1717

1818
#[macro_use] fn f() { }
1919

tests/ui/feature-gates/issue-43106-gating-of-macro_use.stderr

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,11 @@ error: arguments to `macro_use` are not allowed here
1616
LL | #![macro_use(my_macro)]
1717
| ^^^^^^^^^^^^^^^^^^^^^^^
1818

19-
error: malformed `macro_use` attribute input
19+
error: valid forms for the attribute are `#[macro_use(name1, name2, ...)]` and `#[macro_use]`
2020
--> $DIR/issue-43106-gating-of-macro_use.rs:15:5
2121
|
2222
LL | #[macro_use = "2700"] struct S;
2323
| ^^^^^^^^^^^^^^^^^^^^^
24-
|
25-
help: the following are the possible correct uses
26-
|
27-
LL - #[macro_use = "2700"] struct S;
28-
LL + #[macro_use(name1, name2, ...)] struct S;
29-
|
30-
LL - #[macro_use = "2700"] struct S;
31-
LL + #[macro_use] struct S;
32-
|
3324

3425
error: aborting due to 4 previous errors
3526

tests/ui/lint/unused/unused-attr-duplicate.stderr

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,6 @@ note: the lint level is defined here
1515
LL | #![deny(unused_attributes)]
1616
| ^^^^^^^^^^^^^^^^^
1717

18-
error: unused attribute
19-
--> $DIR/unused-attr-duplicate.rs:37:1
20-
|
21-
LL | #[macro_use]
22-
| ^^^^^^^^^^^^ help: remove this attribute
23-
|
24-
note: attribute also specified here
25-
--> $DIR/unused-attr-duplicate.rs:36:1
26-
|
27-
LL | #[macro_use]
28-
| ^^^^^^^^^^^^
29-
3018
error: unused attribute
3119
--> $DIR/unused-attr-duplicate.rs:55:1
3220
|
@@ -140,6 +128,18 @@ note: attribute also specified here
140128
LL | #[macro_export]
141129
| ^^^^^^^^^^^^^^^
142130

131+
error: unused attribute
132+
--> $DIR/unused-attr-duplicate.rs:37:1
133+
|
134+
LL | #[macro_use]
135+
| ^^^^^^^^^^^^ help: remove this attribute
136+
|
137+
note: attribute also specified here
138+
--> $DIR/unused-attr-duplicate.rs:36:1
139+
|
140+
LL | #[macro_use]
141+
| ^^^^^^^^^^^^
142+
143143
error: unused attribute
144144
--> $DIR/unused-attr-duplicate.rs:47:1
145145
|

tests/ui/lint/unused/unused-attr-macro-rules.stderr

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
error: `#[macro_use]` only has an effect on `extern crate` and modules
2-
--> $DIR/unused-attr-macro-rules.rs:7:1
1+
error: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
2+
--> $DIR/unused-attr-macro-rules.rs:9:1
33
|
4-
LL | #[macro_use]
5-
| ^^^^^^^^^^^^
4+
LL | #[recursion_limit="1"]
5+
| ^^^^^^^^^^^^^^^^^^^^^^
66
|
77
note: the lint level is defined here
88
--> $DIR/unused-attr-macro-rules.rs:1:9
99
|
1010
LL | #![deny(unused_attributes)]
1111
| ^^^^^^^^^^^^^^^^^
1212

13-
error: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
14-
--> $DIR/unused-attr-macro-rules.rs:9:1
13+
error: `#[macro_use]` only has an effect on `extern crate` and modules
14+
--> $DIR/unused-attr-macro-rules.rs:7:1
1515
|
16-
LL | #[recursion_limit="1"]
17-
| ^^^^^^^^^^^^^^^^^^^^^^
16+
LL | #[macro_use]
17+
| ^^^^^^^^^^^^
1818

1919
error: `#[path]` only has an effect on modules
2020
--> $DIR/unused-attr-macro-rules.rs:8:1

tests/ui/macros/genercs-in-path-with-prettry-hir.stdout

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#[prelude_import]
22
use ::std::prelude::rust_2015::*;
3-
#[macro_use]
3+
#[attr = MacroUse {arguments: UseAll}]
44
extern crate std;
55
//@ compile-flags: -Zunpretty=hir
66
//@ edition: 2015

0 commit comments

Comments
 (0)