mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-10-31 13:04:42 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			19 lines
		
	
	
		
			279 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			19 lines
		
	
	
		
			279 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
| // run-pass
 | |
| #![allow(unreachable_patterns)]
 | |
| #![feature(box_patterns)]
 | |
| 
 | |
| struct Foo{}
 | |
| 
 | |
| pub fn main() {
 | |
|     let b = Box::new(Foo{});
 | |
|     let box f = &b;
 | |
|     let _: &Foo = f;
 | |
| 
 | |
|     match &&&b {
 | |
|         box f => {
 | |
|             let _: &Foo = f;
 | |
|         },
 | |
|         _ => panic!(),
 | |
|     }
 | |
| }
 | 
