mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-10-31 04:57:19 +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(false)],
 | |
|       pub fn bar() { });
 | |
| 
 | |
| test!(b,
 | |
|       #[cfg(not(FALSE))],
 | |
|       pub fn bar() { });
 | |
| 
 | |
| // test1!(#[bar])
 | |
| #[rustc_dummy]
 | |
| fn main() {
 | |
|     a::bar(); //~ ERROR cannot find function `bar` in module `a`
 | |
|     b::bar();
 | |
| }
 | 
