mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-11-04 06:56:14 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			24 lines
		
	
	
		
			445 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			24 lines
		
	
	
		
			445 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
// force-host
 | 
						|
// no-prefer-dynamic
 | 
						|
 | 
						|
#![crate_type = "proc-macro"]
 | 
						|
 | 
						|
extern crate proc_macro;
 | 
						|
use proc_macro::*;
 | 
						|
 | 
						|
#[proc_macro]
 | 
						|
pub fn gen_macro_rules(_: TokenStream) -> TokenStream {
 | 
						|
    "
 | 
						|
    macro_rules! generated {() => {
 | 
						|
        struct ItemDef;
 | 
						|
        let local_def = 0;
 | 
						|
 | 
						|
        ItemUse; // OK
 | 
						|
        local_use; // ERROR
 | 
						|
        break 'label_use; // ERROR
 | 
						|
 | 
						|
        type DollarCrate = $crate::ItemUse; // OK
 | 
						|
    }}
 | 
						|
    ".parse().unwrap()
 | 
						|
}
 |