mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-10-31 13:04:42 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			19 lines
		
	
	
		
			273 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			19 lines
		
	
	
		
			273 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
| // run-pass
 | |
| #![allow(non_shorthand_field_patterns)]
 | |
| 
 | |
| struct Foo {
 | |
|     x: isize,
 | |
|     y: isize,
 | |
| }
 | |
| 
 | |
| pub fn main() {
 | |
|     let a = Foo { x: 1, y: 2 };
 | |
|     match a {
 | |
|         Foo { x: x, y: y } => println!("yes, {}, {}", x, y)
 | |
|     }
 | |
| 
 | |
|     match a {
 | |
|         Foo { .. } => ()
 | |
|     }
 | |
| }
 | 
