mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-10-30 20:44:34 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			22 lines
		
	
	
		
			351 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			22 lines
		
	
	
		
			351 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
| // Checks that a sibling function (i.e. `foo`) cannot constrain
 | |
| // an RPITIT from another function (`bar`).
 | |
| 
 | |
| trait Trait {
 | |
|     fn foo();
 | |
| 
 | |
|     fn bar() -> impl Sized;
 | |
| }
 | |
| 
 | |
| impl Trait for () {
 | |
|     fn foo() {
 | |
|         let _: String = Self::bar();
 | |
|         //~^ ERROR mismatched types
 | |
|     }
 | |
| 
 | |
|     fn bar() -> impl Sized {
 | |
|         loop {}
 | |
|     }
 | |
| }
 | |
| 
 | |
| fn main() {}
 | 
