mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-10-31 04:57:19 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			26 lines
		
	
	
		
			406 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			26 lines
		
	
	
		
			406 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
| // check-pass
 | |
| // Tests that we properly handle a nested macro expansion
 | |
| // involving a `#[doc]` attribute
 | |
| #![deny(missing_docs)]
 | |
| //! Crate docs
 | |
| 
 | |
| macro_rules! doc_comment {
 | |
|     ($x:expr, $($tt:tt)*) => {
 | |
|         #[doc = $x]
 | |
|         $($tt)*
 | |
|     }
 | |
| }
 | |
| 
 | |
| macro_rules! make_comment {
 | |
|     () => {
 | |
|         doc_comment!("Function docs",
 | |
|             pub fn bar() {}
 | |
|         );
 | |
|     }
 | |
| }
 | |
| 
 | |
| 
 | |
| make_comment!();
 | |
| 
 | |
| fn main() {}
 | 
