mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-11-04 06:56:14 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			17 lines
		
	
	
		
			390 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			17 lines
		
	
	
		
			390 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
use std::ops::Deref;
 | 
						|
 | 
						|
// Make sure that method probe error reporting doesn't get too tangled up
 | 
						|
// on this infinite deref impl. See #130224.
 | 
						|
 | 
						|
struct Wrap<T>(T);
 | 
						|
impl<T> Deref for Wrap<T> {
 | 
						|
    type Target = Wrap<Wrap<T>>;
 | 
						|
    fn deref(&self) -> &Wrap<Wrap<T>> { todo!() }
 | 
						|
}
 | 
						|
 | 
						|
fn main() {
 | 
						|
    Wrap(1).lmao();
 | 
						|
    //~^ ERROR reached the recursion limit
 | 
						|
    //~| ERROR no method named `lmao`
 | 
						|
}
 |