mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-11-04 06:56:14 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			18 lines
		
	
	
		
			252 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			18 lines
		
	
	
		
			252 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
// run-pass
 | 
						|
#![allow(dead_code)]
 | 
						|
 | 
						|
#[macro_export]
 | 
						|
macro_rules! state {
 | 
						|
    ( $( $name:ident : $field:ty )* ) => (
 | 
						|
        #[derive(Default)]
 | 
						|
        struct State {
 | 
						|
            $($name : $field),*
 | 
						|
        }
 | 
						|
    )
 | 
						|
}
 | 
						|
 | 
						|
state! { x: i64 }
 | 
						|
 | 
						|
pub fn main() {
 | 
						|
}
 |