mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-10-28 11:38:01 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			26 lines
		
	
	
		
			391 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			26 lines
		
	
	
		
			391 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
| //@ revisions: current next
 | |
| //@[next] compile-flags: -Znext-solver
 | |
| //@[current] check-pass
 | |
| 
 | |
| trait MyDebug {
 | |
|     fn my_debug(&self);
 | |
| }
 | |
| 
 | |
| impl<T> MyDebug for T
 | |
| where
 | |
|     T: std::fmt::Debug,
 | |
| {
 | |
|     fn my_debug(&self) {}
 | |
| }
 | |
| 
 | |
| fn my_foo() -> impl std::fmt::Debug {
 | |
|     if false {
 | |
|         let x = my_foo();
 | |
|         //[next]~^ type annotations needed
 | |
|         x.my_debug();
 | |
|     }
 | |
|     ()
 | |
| }
 | |
| 
 | |
| fn main() {}
 | 
