mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-10-31 13:04:42 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			15 lines
		
	
	
		
			285 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			15 lines
		
	
	
		
			285 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
| // check-pass
 | |
| 
 | |
| trait Trait {
 | |
|     fn method(&self) {
 | |
|         // Items inside a block turn it into a module internally.
 | |
|         struct S;
 | |
|         impl Trait for S {}
 | |
| 
 | |
|         // OK, `Trait` is in scope here from method resolution point of view.
 | |
|         S.method();
 | |
|     }
 | |
| }
 | |
| 
 | |
| fn main() {}
 | 
