mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 09:14:20 +00:00
21 lines
394 B
Rust
21 lines
394 B
Rust
#![feature(rustc_attrs)]
|
|
|
|
macro_rules! test { ($nm:ident,
|
|
#[$a:meta],
|
|
$i:item) => (mod $nm { #![$a] $i }); }
|
|
|
|
test!(a,
|
|
#[cfg(qux)],
|
|
pub fn bar() { });
|
|
|
|
test!(b,
|
|
#[cfg(not(qux))],
|
|
pub fn bar() { });
|
|
|
|
#[rustc_dummy]
|
|
fn main() {
|
|
a::bar();
|
|
//~^ ERROR failed to resolve: use of undeclared crate or module `a`
|
|
b::bar();
|
|
}
|