
I'm removing empty identifiers everywhere, because in practice they always mean "no identifier" rather than "empty identifier". (An empty identifier is impossible.) It's better to use `Option` to mean "no identifier" because you then can't forget about the "no identifier" possibility. Some specifics: - When testing an attribute for a single name, the commit uses the `has_name` method. - When testing an attribute for multiple names, the commit uses the new `has_any_name` method. - When using `match` on an attribute, the match arms now have `Some` on them. In the tests, we now avoid printing empty identifiers by not printing the identifier in the `error:` line at all, instead letting the carets point out the problem.
39 lines
710 B
Rust
39 lines
710 B
Rust
//@ revisions: deny allow
|
|
//@[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_export(not_local_inner_macros)]
|
|
//[deny]~^ ERROR invalid `#[macro_export]` argument
|
|
macro_rules! b {
|
|
() => ()
|
|
}
|
|
|
|
#[macro_export]
|
|
macro_rules! c {
|
|
() => ()
|
|
}
|
|
#[macro_export(local_inner_macros)]
|
|
macro_rules! d {
|
|
() => ()
|
|
}
|
|
|
|
#[macro_export()]
|
|
macro_rules! e {
|
|
() => ()
|
|
}
|
|
|
|
#[macro_export("blah")]
|
|
//[deny]~^ ERROR invalid `#[macro_export]` argument
|
|
macro_rules! f {
|
|
() => ()
|
|
}
|
|
|
|
fn main() {}
|