rust/tests/ui/macros/macro-inner-attributes.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

21 lines
398 B
Rust
Raw Normal View History

#![feature(rustc_attrs)]
macro_rules! test { ($nm:ident,
#[$a:meta],
$i:item) => (mod $nm { #![$a] $i }); }
test!(a,
#[cfg(FALSE)],
pub fn bar() { });
test!(b,
#[cfg(not(FALSE))],
pub fn bar() { });
#[rustc_dummy]
fn main() {
a::bar();
2020-08-27 12:27:14 +00:00
//~^ ERROR failed to resolve: use of undeclared crate or module `a`
b::bar();
}