mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-10-31 13:04:42 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			17 lines
		
	
	
		
			343 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			17 lines
		
	
	
		
			343 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
| //@ run-pass
 | |
| macro_rules! descriptions {
 | |
|     ($name:ident is $desc:expr) => {
 | |
|         // Check that we will correctly expand attributes
 | |
|         #[doc = $desc]
 | |
|         #[allow(dead_code)]
 | |
|         const $name : &'static str = $desc;
 | |
|     }
 | |
| }
 | |
| 
 | |
| // item
 | |
| descriptions! { DOG is "an animal" }
 | |
| descriptions! { RUST is "a language" }
 | |
| 
 | |
| pub fn main() {
 | |
| }
 | 
