Changes to uitests for macro_export port

Co-authored-by: Anne Stijns <anstijns@gmail.com>
This commit is contained in:
Jonathan Brouwer 2025-09-21 10:21:11 -04:00
parent 6abcadc235
commit f7fa83ec62
No known key found for this signature in database
GPG key ID: F13E55D38C971DEF
10 changed files with 417 additions and 277 deletions

View file

@ -0,0 +1,40 @@
Future incompatibility report: Future breakage diagnostic:
warning: valid forms for the attribute are `#![macro_export(local_inner_macros)]` and `#![macro_export]`
--> $DIR/invalid_macro_export_argument.rs:7:1
|
LL | #[macro_export(hello, world)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #57571 <https://github.com/rust-lang/rust/issues/57571>
Future breakage diagnostic:
warning: valid forms for the attribute are `#![macro_export(local_inner_macros)]` and `#![macro_export]`
--> $DIR/invalid_macro_export_argument.rs:14:1
|
LL | #[macro_export(not_local_inner_macros)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #57571 <https://github.com/rust-lang/rust/issues/57571>
Future breakage diagnostic:
warning: valid forms for the attribute are `#![macro_export(local_inner_macros)]` and `#![macro_export]`
--> $DIR/invalid_macro_export_argument.rs:31:1
|
LL | #[macro_export()]
| ^^^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #57571 <https://github.com/rust-lang/rust/issues/57571>
Future breakage diagnostic:
warning: valid forms for the attribute are `#![macro_export(local_inner_macros)]` and `#![macro_export]`
--> $DIR/invalid_macro_export_argument.rs:38:1
|
LL | #[macro_export("blah")]
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #57571 <https://github.com/rust-lang/rust/issues/57571>

View file

@ -1,26 +1,103 @@
error: `#[macro_export]` can only take 1 or 0 arguments
error: valid forms for the attribute are `#![macro_export(local_inner_macros)]` and `#![macro_export]`
--> $DIR/invalid_macro_export_argument.rs:7:1
|
LL | #[macro_export(hello, world)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #57571 <https://github.com/rust-lang/rust/issues/57571>
note: the lint level is defined here
--> $DIR/invalid_macro_export_argument.rs:4:24
|
LL | #![cfg_attr(deny, deny(invalid_macro_export_arguments))]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: invalid `#[macro_export]` argument
--> $DIR/invalid_macro_export_argument.rs:13:16
error: valid forms for the attribute are `#![macro_export(local_inner_macros)]` and `#![macro_export]`
--> $DIR/invalid_macro_export_argument.rs:14:1
|
LL | #[macro_export(not_local_inner_macros)]
| ^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #57571 <https://github.com/rust-lang/rust/issues/57571>
error: invalid `#[macro_export]` argument
--> $DIR/invalid_macro_export_argument.rs:33:16
error: valid forms for the attribute are `#![macro_export(local_inner_macros)]` and `#![macro_export]`
--> $DIR/invalid_macro_export_argument.rs:31:1
|
LL | #[macro_export()]
| ^^^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #57571 <https://github.com/rust-lang/rust/issues/57571>
error: valid forms for the attribute are `#![macro_export(local_inner_macros)]` and `#![macro_export]`
--> $DIR/invalid_macro_export_argument.rs:38:1
|
LL | #[macro_export("blah")]
| ^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #57571 <https://github.com/rust-lang/rust/issues/57571>
error: aborting due to 3 previous errors
error: aborting due to 4 previous errors
Future incompatibility report: Future breakage diagnostic:
error: valid forms for the attribute are `#![macro_export(local_inner_macros)]` and `#![macro_export]`
--> $DIR/invalid_macro_export_argument.rs:7:1
|
LL | #[macro_export(hello, world)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #57571 <https://github.com/rust-lang/rust/issues/57571>
note: the lint level is defined here
--> $DIR/invalid_macro_export_argument.rs:4:24
|
LL | #![cfg_attr(deny, deny(invalid_macro_export_arguments))]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Future breakage diagnostic:
error: valid forms for the attribute are `#![macro_export(local_inner_macros)]` and `#![macro_export]`
--> $DIR/invalid_macro_export_argument.rs:14:1
|
LL | #[macro_export(not_local_inner_macros)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #57571 <https://github.com/rust-lang/rust/issues/57571>
note: the lint level is defined here
--> $DIR/invalid_macro_export_argument.rs:4:24
|
LL | #![cfg_attr(deny, deny(invalid_macro_export_arguments))]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Future breakage diagnostic:
error: valid forms for the attribute are `#![macro_export(local_inner_macros)]` and `#![macro_export]`
--> $DIR/invalid_macro_export_argument.rs:31:1
|
LL | #[macro_export()]
| ^^^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #57571 <https://github.com/rust-lang/rust/issues/57571>
note: the lint level is defined here
--> $DIR/invalid_macro_export_argument.rs:4:24
|
LL | #![cfg_attr(deny, deny(invalid_macro_export_arguments))]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Future breakage diagnostic:
error: valid forms for the attribute are `#![macro_export(local_inner_macros)]` and `#![macro_export]`
--> $DIR/invalid_macro_export_argument.rs:38:1
|
LL | #[macro_export("blah")]
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #57571 <https://github.com/rust-lang/rust/issues/57571>
note: the lint level is defined here
--> $DIR/invalid_macro_export_argument.rs:4:24
|
LL | #![cfg_attr(deny, deny(invalid_macro_export_arguments))]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View file

@ -5,13 +5,15 @@
#![cfg_attr(allow, allow(invalid_macro_export_arguments))]
#[macro_export(hello, world)]
//[deny]~^ ERROR `#[macro_export]` can only take 1 or 0 arguments
//[deny]~^ ERROR valid forms for the attribute are
//[deny]~| WARN this was previously accepted
macro_rules! a {
() => ()
}
#[macro_export(not_local_inner_macros)]
//[deny]~^ ERROR invalid `#[macro_export]` argument
//[deny]~^ ERROR valid forms for the attribute are
//[deny]~| WARN this was previously accepted
macro_rules! b {
() => ()
}
@ -20,18 +22,22 @@ macro_rules! b {
macro_rules! c {
() => ()
}
#[macro_export(local_inner_macros)]
macro_rules! d {
() => ()
}
#[macro_export()]
//[deny]~^ ERROR valid forms for the attribute are
//[deny]~| WARN this was previously accepted
macro_rules! e {
() => ()
}
#[macro_export("blah")]
//[deny]~^ ERROR invalid `#[macro_export]` argument
//[deny]~^ ERROR valid forms for the attribute are
//[deny]~| WARN this was previously accepted
macro_rules! f {
() => ()
}

View file

@ -211,7 +211,7 @@ extern crate wloop;
//~^ ERROR can't find crate for `wloop` [E0463]
#[macro_export = 18]
//~^ ERROR malformed `macro_export` attribute input
//~^ ERROR valid forms for the attribute are
#[allow_internal_unsafe = 1]
//~^ ERROR malformed
//~| ERROR allow_internal_unsafe side-steps the unsafe_code lint

View file

@ -178,22 +178,6 @@ LL | #[no_link()]
|
= note: for more information, visit <https://doc.rust-lang.org/reference/items/extern-crates.html#the-no_link-attribute>
error: malformed `macro_export` attribute input
--> $DIR/malformed-attrs.rs:213:1
|
LL | #[macro_export = 18]
| ^^^^^^^^^^^^^^^^^^^^
|
= note: for more information, visit <https://doc.rust-lang.org/reference/macros-by-example.html#path-based-scope>
help: the following are the possible correct uses
|
LL - #[macro_export = 18]
LL + #[macro_export(local_inner_macros)]
|
LL - #[macro_export = 18]
LL + #[macro_export]
|
error: the `#[proc_macro]` attribute is only usable with crates of the `proc-macro` crate type
--> $DIR/malformed-attrs.rs:98:1
|
@ -725,6 +709,12 @@ error: valid forms for the attribute are `#[macro_use(name1, name2, ...)]` and `
LL | #[macro_use = 1]
| ^^^^^^^^^^^^^^^^
error: valid forms for the attribute are `#![macro_export(local_inner_macros)]` and `#![macro_export]`
--> $DIR/malformed-attrs.rs:213:1
|
LL | #[macro_export = 18]
| ^^^^^^^^^^^^^^^^^^^^
error[E0565]: malformed `allow_internal_unsafe` attribute input
--> $DIR/malformed-attrs.rs:215:1
|

View file

@ -8,7 +8,7 @@
#![macro_export]
//~^ ERROR: `macro_export` attribute cannot be used at crate level
//~^ ERROR: `#[macro_export]` attribute cannot be used on crates
#![rustc_main]
//~^ ERROR: `rustc_main` attribute cannot be used at crate level
//~| ERROR: use of an internal attribute [E0658]
@ -32,7 +32,6 @@
mod inline {
//~^ NOTE the inner attribute doesn't annotate this module
//~| NOTE the inner attribute doesn't annotate this module
//~| NOTE the inner attribute doesn't annotate this module
mod inner { #![inline] }
//~^ ERROR attribute cannot be used on

View file

@ -8,6 +8,14 @@ LL | #![rustc_main]
= note: the `#[rustc_main]` attribute is an internal implementation detail that will never be stable
= note: the `#[rustc_main]` attribute is used internally to specify test entry point function
error: `#[macro_export]` attribute cannot be used on crates
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:10:1
|
LL | #![macro_export]
| ^^^^^^^^^^^^^^^^
|
= help: `#[macro_export]` can only be applied to macro defs
error: `#[path]` attribute cannot be used on crates
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:19:1
|
@ -49,7 +57,7 @@ LL | #[inline]
= help: `#[inline]` can only be applied to functions
error: `#[inline]` attribute cannot be used on modules
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:37:17
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:36:17
|
LL | mod inner { #![inline] }
| ^^^^^^^^^^
@ -57,7 +65,7 @@ LL | mod inner { #![inline] }
= help: `#[inline]` can only be applied to functions
error: `#[inline]` attribute cannot be used on structs
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:46:5
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:45:5
|
LL | #[inline] struct S;
| ^^^^^^^^^
@ -65,7 +73,7 @@ LL | #[inline] struct S;
= help: `#[inline]` can only be applied to functions
error: `#[inline]` attribute cannot be used on type aliases
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:49:5
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:48:5
|
LL | #[inline] type T = S;
| ^^^^^^^^^
@ -73,7 +81,7 @@ LL | #[inline] type T = S;
= help: `#[inline]` can only be applied to functions
error: `#[inline]` attribute cannot be used on inherent impl blocks
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:52:5
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:51:5
|
LL | #[inline] impl S { }
| ^^^^^^^^^
@ -81,7 +89,7 @@ LL | #[inline] impl S { }
= help: `#[inline]` can only be applied to functions
error: `#[export_name]` attribute cannot be used on modules
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:82:1
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:81:1
|
LL | #[export_name = "2200"]
| ^^^^^^^^^^^^^^^^^^^^^^^
@ -89,7 +97,7 @@ LL | #[export_name = "2200"]
= help: `#[export_name]` can be applied to functions and statics
error: `#[export_name]` attribute cannot be used on modules
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:85:17
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:84:17
|
LL | mod inner { #![export_name="2200"] }
| ^^^^^^^^^^^^^^^^^^^^^^
@ -97,7 +105,7 @@ LL | mod inner { #![export_name="2200"] }
= help: `#[export_name]` can be applied to functions and statics
error: `#[export_name]` attribute cannot be used on structs
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:90:5
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:89:5
|
LL | #[export_name = "2200"] struct S;
| ^^^^^^^^^^^^^^^^^^^^^^^
@ -105,7 +113,7 @@ LL | #[export_name = "2200"] struct S;
= help: `#[export_name]` can be applied to functions and statics
error: `#[export_name]` attribute cannot be used on type aliases
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:93:5
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:92:5
|
LL | #[export_name = "2200"] type T = S;
| ^^^^^^^^^^^^^^^^^^^^^^^
@ -113,7 +121,7 @@ LL | #[export_name = "2200"] type T = S;
= help: `#[export_name]` can be applied to functions and statics
error: `#[export_name]` attribute cannot be used on inherent impl blocks
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:96:5
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:95:5
|
LL | #[export_name = "2200"] impl S { }
| ^^^^^^^^^^^^^^^^^^^^^^^
@ -121,7 +129,7 @@ LL | #[export_name = "2200"] impl S { }
= help: `#[export_name]` can be applied to functions and statics
error: `#[export_name]` attribute cannot be used on required trait methods
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:100:9
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:99:9
|
LL | #[export_name = "2200"] fn foo();
| ^^^^^^^^^^^^^^^^^^^^^^^
@ -129,7 +137,7 @@ LL | #[export_name = "2200"] fn foo();
= help: `#[export_name]` can be applied to statics, functions, inherent methods, provided trait methods, and trait methods in impl blocks
error: attribute should be applied to an `extern crate` item
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:56:1
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:55:1
|
LL | #[no_link]
| ^^^^^^^^^^
@ -143,7 +151,7 @@ LL | | }
| |_- not an `extern crate` item
error[E0517]: attribute should be applied to a struct, enum, or union
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:107:8
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:106:8
|
LL | #[repr(C)]
| ^
@ -156,7 +164,7 @@ LL | | }
| |_- not a struct, enum, or union
error[E0517]: attribute should be applied to a struct, enum, or union
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:131:8
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:130:8
|
LL | #[repr(Rust)]
| ^^^^
@ -174,21 +182,6 @@ error: attribute should be applied to an `extern crate` item
LL | #![no_link]
| ^^^^^^^^^^^ not an `extern crate` item
error: `macro_export` attribute cannot be used at crate level
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:10:1
|
LL | #![macro_export]
| ^^^^^^^^^^^^^^^^
...
LL | mod inline {
| ------ the inner attribute doesn't annotate this module
|
help: perhaps you meant to use an outer attribute
|
LL - #![macro_export]
LL + #[macro_export]
|
error: `rustc_main` attribute cannot be used at crate level
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:12:1
|
@ -220,85 +213,85 @@ LL + #[repr()]
|
error: attribute should be applied to an `extern crate` item
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:61:17
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:60:17
|
LL | mod inner { #![no_link] }
| ------------^^^^^^^^^^^-- not an `extern crate` item
error: attribute should be applied to an `extern crate` item
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:65:5
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:64:5
|
LL | #[no_link] fn f() { }
| ^^^^^^^^^^ ---------- not an `extern crate` item
error: attribute should be applied to an `extern crate` item
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:69:5
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:68:5
|
LL | #[no_link] struct S;
| ^^^^^^^^^^ --------- not an `extern crate` item
error: attribute should be applied to an `extern crate` item
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:73:5
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:72:5
|
LL | #[no_link]type T = S;
| ^^^^^^^^^^----------- not an `extern crate` item
error: attribute should be applied to an `extern crate` item
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:77:5
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:76:5
|
LL | #[no_link] impl S { }
| ^^^^^^^^^^ ---------- not an `extern crate` item
error[E0517]: attribute should be applied to a struct, enum, or union
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:111:25
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:110:25
|
LL | mod inner { #![repr(C)] }
| --------------------^---- not a struct, enum, or union
error[E0517]: attribute should be applied to a struct, enum, or union
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:115:12
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:114:12
|
LL | #[repr(C)] fn f() { }
| ^ ---------- not a struct, enum, or union
error[E0517]: attribute should be applied to a struct, enum, or union
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:121:12
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:120:12
|
LL | #[repr(C)] type T = S;
| ^ ----------- not a struct, enum, or union
error[E0517]: attribute should be applied to a struct, enum, or union
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:125:12
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:124:12
|
LL | #[repr(C)] impl S { }
| ^ ---------- not a struct, enum, or union
error[E0517]: attribute should be applied to a struct, enum, or union
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:135:25
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:134:25
|
LL | mod inner { #![repr(Rust)] }
| --------------------^^^^---- not a struct, enum, or union
error[E0517]: attribute should be applied to a struct, enum, or union
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:139:12
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:138:12
|
LL | #[repr(Rust)] fn f() { }
| ^^^^ ---------- not a struct, enum, or union
error[E0517]: attribute should be applied to a struct, enum, or union
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:145:12
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:144:12
|
LL | #[repr(Rust)] type T = S;
| ^^^^ ----------- not a struct, enum, or union
error[E0517]: attribute should be applied to a struct, enum, or union
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:149:12
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:148:12
|
LL | #[repr(Rust)] impl S { }
| ^^^^ ---------- not a struct, enum, or union
error: valid forms for the attribute are `#[inline(always)]`, `#[inline(never)]`, and `#[inline]`
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:40:5
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:39:5
|
LL | #[inline = "2100"] fn f() { }
| ^^^^^^^^^^^^^^^^^^
@ -313,7 +306,7 @@ Some errors have detailed explanations: E0517, E0658.
For more information about an error, try `rustc --explain E0517`.
Future incompatibility report: Future breakage diagnostic:
error: valid forms for the attribute are `#[inline(always)]`, `#[inline(never)]`, and `#[inline]`
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:40:5
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:39:5
|
LL | #[inline = "2100"] fn f() { }
| ^^^^^^^^^^^^^^^^^^

View file

@ -214,22 +214,40 @@ mod macro_use {
}
#[macro_export]
//~^ WARN `#[macro_export]` only has an effect on macro definitions
//~^ WARN `#[macro_export]` attribute cannot be used on modules [unused_attributes]
//~| WARN previously accepted
//~| HELP can only be applied to
//~| HELP remove the attribute
mod macro_export {
mod inner { #![macro_export] }
//~^ WARN `#[macro_export]` only has an effect on macro definitions
//~^ WARN `#[macro_export]` attribute cannot be used on modules
//~| WARN previously accepted
//~| HELP can only be applied to
//~| HELP remove the attribute
#[macro_export] fn f() { }
//~^ WARN `#[macro_export]` only has an effect on macro definitions
//~^ WARN `#[macro_export]` attribute cannot be used on function
//~| WARN previously accepted
//~| HELP can only be applied to
//~| HELP remove the attribute
#[macro_export] struct S;
//~^ WARN `#[macro_export]` only has an effect on macro definitions
//~^ WARN `#[macro_export]` attribute cannot be used on structs
//~| WARN previously accepted
//~| HELP can only be applied to
//~| HELP remove the attribute
#[macro_export] type T = S;
//~^ WARN `#[macro_export]` only has an effect on macro definitions
//~^ WARN `#[macro_export]` attribute cannot be used on type aliases
//~| WARN previously accepted
//~| HELP can only be applied to
//~| HELP remove the attribute
#[macro_export] impl S { }
//~^ WARN `#[macro_export]` only has an effect on macro definitions
//~^ WARN `#[macro_export]` attribute cannot be used on inherent impl blocks
//~| WARN previously accepted
//~| HELP can only be applied to
//~| HELP remove the attribute
}
// At time of unit test authorship, if compiling without `--test` then

View file

@ -53,18 +53,6 @@ note: attribute also specified here
LL | #![no_builtins]
| ^^^^^^^^^^^^^^^
error: unused attribute
--> $DIR/unused-attr-duplicate.rs:44:5
|
LL | #[macro_export]
| ^^^^^^^^^^^^^^^ help: remove this attribute
|
note: attribute also specified here
--> $DIR/unused-attr-duplicate.rs:43:5
|
LL | #[macro_export]
| ^^^^^^^^^^^^^^^
error: unused attribute
--> $DIR/unused-attr-duplicate.rs:41:1
|
@ -77,6 +65,18 @@ note: attribute also specified here
LL | #[macro_use]
| ^^^^^^^^^^^^
error: unused attribute
--> $DIR/unused-attr-duplicate.rs:44:5
|
LL | #[macro_export]
| ^^^^^^^^^^^^^^^ help: remove this attribute
|
note: attribute also specified here
--> $DIR/unused-attr-duplicate.rs:43:5
|
LL | #[macro_export]
| ^^^^^^^^^^^^^^^
error: unused attribute
--> $DIR/unused-attr-duplicate.rs:51:1
|