mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-10-31 13:04:42 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			17 lines
		
	
	
		
			267 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			17 lines
		
	
	
		
			267 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
| //@ run-pass
 | |
| #![allow(unused_variables)]
 | |
| #![deny(non_shorthand_field_patterns)]
 | |
| 
 | |
| pub struct Value<A> { pub value: A }
 | |
| 
 | |
| #[macro_export]
 | |
| macro_rules! pat {
 | |
|     ($a:pat) => {
 | |
|         Value { value: $a }
 | |
|     };
 | |
| }
 | |
| 
 | |
| fn main() {
 | |
|     let pat!(value) = Value { value: () };
 | |
| }
 | 
