mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-10-31 13:04:42 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			20 lines
		
	
	
		
			397 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			20 lines
		
	
	
		
			397 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
| //@ dont-require-annotations: NOTE
 | |
| 
 | |
| static foo: i32 = 0;
 | |
| 
 | |
| fn bar(foo: i32) {}
 | |
| //~^ ERROR function parameters cannot shadow statics
 | |
| //~| NOTE cannot be named the same as a static
 | |
| 
 | |
| mod submod {
 | |
|     pub static answer: i32 = 42;
 | |
| }
 | |
| 
 | |
| use self::submod::answer;
 | |
| 
 | |
| fn question(answer: i32) {}
 | |
| //~^ ERROR function parameters cannot shadow statics
 | |
| //~| NOTE cannot be named the same as a static
 | |
| fn main() {
 | |
| }
 | 
