Add invalid_macro_export_arguments to built-in macro list
This commit is contained in:
parent
901fdb3b04
commit
183c7904e9
4 changed files with 31 additions and 19 deletions
|
@ -3377,6 +3377,7 @@ declare_lint_pass! {
|
||||||
IMPLIED_BOUNDS_ENTAILMENT,
|
IMPLIED_BOUNDS_ENTAILMENT,
|
||||||
BYTE_SLICE_IN_PACKED_STRUCT_WITH_DERIVE,
|
BYTE_SLICE_IN_PACKED_STRUCT_WITH_DERIVE,
|
||||||
AMBIGUOUS_GLOB_REEXPORTS,
|
AMBIGUOUS_GLOB_REEXPORTS,
|
||||||
|
INVALID_MACRO_EXPORT_ARGUMENTS,
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
error: `#[macro_export]` can only take 1 or 0 arguments
|
||||||
|
--> $DIR/invalid_macro_export_argument.rs:7:1
|
||||||
|
|
|
||||||
|
LL | #[macro_export(hello, world)]
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
|
||||||
|
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: `not_local_inner_macros` isn't a valid `#[macro_export]` argument
|
||||||
|
--> $DIR/invalid_macro_export_argument.rs:13:16
|
||||||
|
|
|
||||||
|
LL | #[macro_export(not_local_inner_macros)]
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: aborting due to 2 previous errors
|
||||||
|
|
|
@ -1,10 +1,17 @@
|
||||||
// check-pass
|
// revisions: deny allow
|
||||||
#[macro_export(hello, world)] //~ WARN `#[macro_export]` can only take 1 or 0 arguments
|
//[allow] check-pass
|
||||||
|
|
||||||
|
#![cfg_attr(deny, deny(invalid_macro_export_arguments))]
|
||||||
|
#![cfg_attr(allow, allow(invalid_macro_export_arguments))]
|
||||||
|
|
||||||
|
#[macro_export(hello, world)]
|
||||||
|
//[deny]~^ ERROR `#[macro_export]` can only take 1 or 0 arguments
|
||||||
macro_rules! a {
|
macro_rules! a {
|
||||||
() => ()
|
() => ()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[macro_export(not_local_inner_macros)] //~ WARN `not_local_inner_macros` isn't a valid `#[macro_export]` argument
|
#[macro_export(not_local_inner_macros)]
|
||||||
|
//[deny]~^ ERROR `not_local_inner_macros` isn't a valid `#[macro_export]` argument
|
||||||
macro_rules! b {
|
macro_rules! b {
|
||||||
() => ()
|
() => ()
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,16 +0,0 @@
|
||||||
warning: `#[macro_export]` can only take 1 or 0 arguments
|
|
||||||
--> $DIR/invalid_macro_export_argument.rs:2:1
|
|
||||||
|
|
|
||||||
LL | #[macro_export(hello, world)]
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
|
||||||
= note: `#[warn(invalid_macro_export_arguments)]` on by default
|
|
||||||
|
|
||||||
warning: `not_local_inner_macros` isn't a valid `#[macro_export]` argument
|
|
||||||
--> $DIR/invalid_macro_export_argument.rs:7:16
|
|
||||||
|
|
|
||||||
LL | #[macro_export(not_local_inner_macros)]
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
warning: 2 warnings emitted
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue