mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-10-30 20:44:34 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			18 lines
		
	
	
		
			403 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			18 lines
		
	
	
		
			403 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
| #![deny(unused_variables)]
 | |
| 
 | |
| fn main() {
 | |
|     // type annotation, attributes
 | |
|     #[allow(unused_variables)]
 | |
|     let Some(_): Option<u32> = Some(Default::default()) else {
 | |
|         let x = 1; // OK
 | |
|         return;
 | |
|     };
 | |
| 
 | |
|     let Some(_): Option<u32> = Some(Default::default()) else {
 | |
|         let x = 1; //~ ERROR unused variable: `x`
 | |
|         return;
 | |
|     };
 | |
| 
 | |
|     let x = 1; //~ ERROR unused variable: `x`
 | |
| }
 | 
