Skip to content

Commit f7fa83e

Browse files
Changes to uitests for macro_export port
Co-authored-by: Anne Stijns <[email protected]>
1 parent 6abcadc commit f7fa83e

10 files changed

+417
-277
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
Future incompatibility report: Future breakage diagnostic:
2+
warning: valid forms for the attribute are `#![macro_export(local_inner_macros)]` and `#![macro_export]`
3+
--> $DIR/invalid_macro_export_argument.rs:7:1
4+
|
5+
LL | #[macro_export(hello, world)]
6+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7+
|
8+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
9+
= note: for more information, see issue #57571 <https://github.com/rust-lang/rust/issues/57571>
10+
11+
Future breakage diagnostic:
12+
warning: valid forms for the attribute are `#![macro_export(local_inner_macros)]` and `#![macro_export]`
13+
--> $DIR/invalid_macro_export_argument.rs:14:1
14+
|
15+
LL | #[macro_export(not_local_inner_macros)]
16+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
17+
|
18+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
19+
= note: for more information, see issue #57571 <https://github.com/rust-lang/rust/issues/57571>
20+
21+
Future breakage diagnostic:
22+
warning: valid forms for the attribute are `#![macro_export(local_inner_macros)]` and `#![macro_export]`
23+
--> $DIR/invalid_macro_export_argument.rs:31:1
24+
|
25+
LL | #[macro_export()]
26+
| ^^^^^^^^^^^^^^^^^
27+
|
28+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
29+
= note: for more information, see issue #57571 <https://github.com/rust-lang/rust/issues/57571>
30+
31+
Future breakage diagnostic:
32+
warning: valid forms for the attribute are `#![macro_export(local_inner_macros)]` and `#![macro_export]`
33+
--> $DIR/invalid_macro_export_argument.rs:38:1
34+
|
35+
LL | #[macro_export("blah")]
36+
| ^^^^^^^^^^^^^^^^^^^^^^^
37+
|
38+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
39+
= note: for more information, see issue #57571 <https://github.com/rust-lang/rust/issues/57571>
40+
Lines changed: 85 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,103 @@
1-
error: `#[macro_export]` can only take 1 or 0 arguments
1+
error: valid forms for the attribute are `#![macro_export(local_inner_macros)]` and `#![macro_export]`
22
--> $DIR/invalid_macro_export_argument.rs:7:1
33
|
44
LL | #[macro_export(hello, world)]
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
7+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
8+
= note: for more information, see issue #57571 <https://github.com/rust-lang/rust/issues/57571>
79
note: the lint level is defined here
810
--> $DIR/invalid_macro_export_argument.rs:4:24
911
|
1012
LL | #![cfg_attr(deny, deny(invalid_macro_export_arguments))]
1113
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1214

13-
error: invalid `#[macro_export]` argument
14-
--> $DIR/invalid_macro_export_argument.rs:13:16
15+
error: valid forms for the attribute are `#![macro_export(local_inner_macros)]` and `#![macro_export]`
16+
--> $DIR/invalid_macro_export_argument.rs:14:1
1517
|
1618
LL | #[macro_export(not_local_inner_macros)]
17-
| ^^^^^^^^^^^^^^^^^^^^^^
19+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
20+
|
21+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
22+
= note: for more information, see issue #57571 <https://github.com/rust-lang/rust/issues/57571>
23+
24+
error: valid forms for the attribute are `#![macro_export(local_inner_macros)]` and `#![macro_export]`
25+
--> $DIR/invalid_macro_export_argument.rs:31:1
26+
|
27+
LL | #[macro_export()]
28+
| ^^^^^^^^^^^^^^^^^
29+
|
30+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
31+
= note: for more information, see issue #57571 <https://github.com/rust-lang/rust/issues/57571>
1832

19-
error: invalid `#[macro_export]` argument
20-
--> $DIR/invalid_macro_export_argument.rs:33:16
33+
error: valid forms for the attribute are `#![macro_export(local_inner_macros)]` and `#![macro_export]`
34+
--> $DIR/invalid_macro_export_argument.rs:38:1
2135
|
2236
LL | #[macro_export("blah")]
23-
| ^^^^^^
37+
| ^^^^^^^^^^^^^^^^^^^^^^^
38+
|
39+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
40+
= note: for more information, see issue #57571 <https://github.com/rust-lang/rust/issues/57571>
41+
42+
error: aborting due to 4 previous errors
43+
44+
Future incompatibility report: Future breakage diagnostic:
45+
error: valid forms for the attribute are `#![macro_export(local_inner_macros)]` and `#![macro_export]`
46+
--> $DIR/invalid_macro_export_argument.rs:7:1
47+
|
48+
LL | #[macro_export(hello, world)]
49+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
50+
|
51+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
52+
= note: for more information, see issue #57571 <https://github.com/rust-lang/rust/issues/57571>
53+
note: the lint level is defined here
54+
--> $DIR/invalid_macro_export_argument.rs:4:24
55+
|
56+
LL | #![cfg_attr(deny, deny(invalid_macro_export_arguments))]
57+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
58+
59+
Future breakage diagnostic:
60+
error: valid forms for the attribute are `#![macro_export(local_inner_macros)]` and `#![macro_export]`
61+
--> $DIR/invalid_macro_export_argument.rs:14:1
62+
|
63+
LL | #[macro_export(not_local_inner_macros)]
64+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
65+
|
66+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
67+
= note: for more information, see issue #57571 <https://github.com/rust-lang/rust/issues/57571>
68+
note: the lint level is defined here
69+
--> $DIR/invalid_macro_export_argument.rs:4:24
70+
|
71+
LL | #![cfg_attr(deny, deny(invalid_macro_export_arguments))]
72+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2473

25-
error: aborting due to 3 previous errors
74+
Future breakage diagnostic:
75+
error: valid forms for the attribute are `#![macro_export(local_inner_macros)]` and `#![macro_export]`
76+
--> $DIR/invalid_macro_export_argument.rs:31:1
77+
|
78+
LL | #[macro_export()]
79+
| ^^^^^^^^^^^^^^^^^
80+
|
81+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
82+
= note: for more information, see issue #57571 <https://github.com/rust-lang/rust/issues/57571>
83+
note: the lint level is defined here
84+
--> $DIR/invalid_macro_export_argument.rs:4:24
85+
|
86+
LL | #![cfg_attr(deny, deny(invalid_macro_export_arguments))]
87+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
88+
89+
Future breakage diagnostic:
90+
error: valid forms for the attribute are `#![macro_export(local_inner_macros)]` and `#![macro_export]`
91+
--> $DIR/invalid_macro_export_argument.rs:38:1
92+
|
93+
LL | #[macro_export("blah")]
94+
| ^^^^^^^^^^^^^^^^^^^^^^^
95+
|
96+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
97+
= note: for more information, see issue #57571 <https://github.com/rust-lang/rust/issues/57571>
98+
note: the lint level is defined here
99+
--> $DIR/invalid_macro_export_argument.rs:4:24
100+
|
101+
LL | #![cfg_attr(deny, deny(invalid_macro_export_arguments))]
102+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
26103

tests/ui/attributes/invalid_macro_export_argument.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@
55
#![cfg_attr(allow, allow(invalid_macro_export_arguments))]
66

77
#[macro_export(hello, world)]
8-
//[deny]~^ ERROR `#[macro_export]` can only take 1 or 0 arguments
8+
//[deny]~^ ERROR valid forms for the attribute are
9+
//[deny]~| WARN this was previously accepted
910
macro_rules! a {
1011
() => ()
1112
}
1213

1314
#[macro_export(not_local_inner_macros)]
14-
//[deny]~^ ERROR invalid `#[macro_export]` argument
15+
//[deny]~^ ERROR valid forms for the attribute are
16+
//[deny]~| WARN this was previously accepted
1517
macro_rules! b {
1618
() => ()
1719
}
@@ -20,18 +22,22 @@ macro_rules! b {
2022
macro_rules! c {
2123
() => ()
2224
}
25+
2326
#[macro_export(local_inner_macros)]
2427
macro_rules! d {
2528
() => ()
2629
}
2730

2831
#[macro_export()]
32+
//[deny]~^ ERROR valid forms for the attribute are
33+
//[deny]~| WARN this was previously accepted
2934
macro_rules! e {
3035
() => ()
3136
}
3237

3338
#[macro_export("blah")]
34-
//[deny]~^ ERROR invalid `#[macro_export]` argument
39+
//[deny]~^ ERROR valid forms for the attribute are
40+
//[deny]~| WARN this was previously accepted
3541
macro_rules! f {
3642
() => ()
3743
}

tests/ui/attributes/malformed-attrs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ extern crate wloop;
211211
//~^ ERROR can't find crate for `wloop` [E0463]
212212

213213
#[macro_export = 18]
214-
//~^ ERROR malformed `macro_export` attribute input
214+
//~^ ERROR valid forms for the attribute are
215215
#[allow_internal_unsafe = 1]
216216
//~^ ERROR malformed
217217
//~| ERROR allow_internal_unsafe side-steps the unsafe_code lint

tests/ui/attributes/malformed-attrs.stderr

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -178,22 +178,6 @@ LL | #[no_link()]
178178
|
179179
= note: for more information, visit <https://doc.rust-lang.org/reference/items/extern-crates.html#the-no_link-attribute>
180180

181-
error: malformed `macro_export` attribute input
182-
--> $DIR/malformed-attrs.rs:213:1
183-
|
184-
LL | #[macro_export = 18]
185-
| ^^^^^^^^^^^^^^^^^^^^
186-
|
187-
= note: for more information, visit <https://doc.rust-lang.org/reference/macros-by-example.html#path-based-scope>
188-
help: the following are the possible correct uses
189-
|
190-
LL - #[macro_export = 18]
191-
LL + #[macro_export(local_inner_macros)]
192-
|
193-
LL - #[macro_export = 18]
194-
LL + #[macro_export]
195-
|
196-
197181
error: the `#[proc_macro]` attribute is only usable with crates of the `proc-macro` crate type
198182
--> $DIR/malformed-attrs.rs:98:1
199183
|
@@ -725,6 +709,12 @@ error: valid forms for the attribute are `#[macro_use(name1, name2, ...)]` and `
725709
LL | #[macro_use = 1]
726710
| ^^^^^^^^^^^^^^^^
727711

712+
error: valid forms for the attribute are `#![macro_export(local_inner_macros)]` and `#![macro_export]`
713+
--> $DIR/malformed-attrs.rs:213:1
714+
|
715+
LL | #[macro_export = 18]
716+
| ^^^^^^^^^^^^^^^^^^^^
717+
728718
error[E0565]: malformed `allow_internal_unsafe` attribute input
729719
--> $DIR/malformed-attrs.rs:215:1
730720
|

tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs-error.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99

1010
#![macro_export]
11-
//~^ ERROR: `macro_export` attribute cannot be used at crate level
11+
//~^ ERROR: `#[macro_export]` attribute cannot be used on crates
1212
#![rustc_main]
1313
//~^ ERROR: `rustc_main` attribute cannot be used at crate level
1414
//~| ERROR: use of an internal attribute [E0658]
@@ -32,7 +32,6 @@
3232
mod inline {
3333
//~^ NOTE the inner attribute doesn't annotate this module
3434
//~| NOTE the inner attribute doesn't annotate this module
35-
//~| NOTE the inner attribute doesn't annotate this module
3635

3736
mod inner { #![inline] }
3837
//~^ ERROR attribute cannot be used on

0 commit comments

Comments
 (0)