mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-10-31 13:04:42 +00:00 
			
		
		
		
	 bdf4e3de9c
			
		
	
	
		bdf4e3de9c
		
	
	
	
	
		
			
			The compiler should emit a more specific error when the `#[macro_export]` attribute is present on a decl macro, instead of silently ignoring it. This commit adds the required error message in rustc_passes/messages.ftl, as well as a note. A new variant is added to the `errors::MacroExport` enum, specifically for the case where the attribute is added to a macro 2.0.
		
			
				
	
	
		
			10 lines
		
	
	
		
			238 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			10 lines
		
	
	
		
			238 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
| // Using #[macro_export] on a decl macro has no effect and should warn
 | |
| 
 | |
| #![feature(decl_macro)]
 | |
| #![deny(unused)]
 | |
| 
 | |
| #[macro_export] //~ ERROR `#[macro_export]` has no effect on declarative macro definitions
 | |
| pub macro foo() {}
 | |
| 
 | |
| fn main() {}
 |