mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-11-04 15:05:30 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			26 lines
		
	
	
		
			403 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			26 lines
		
	
	
		
			403 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
//@ build-fail
 | 
						|
//~^ cycle detected when computing layout of `Wrapper<()>`
 | 
						|
 | 
						|
trait Trait {
 | 
						|
    type Assoc;
 | 
						|
}
 | 
						|
 | 
						|
impl Trait for () {
 | 
						|
    type Assoc = Wrapper<()>;
 | 
						|
}
 | 
						|
 | 
						|
struct Wrapper<T: Trait> {
 | 
						|
    _x: <T as Trait>::Assoc,
 | 
						|
}
 | 
						|
 | 
						|
fn abi<T: Trait>(_: Option<Wrapper<T>>) {}
 | 
						|
//~^ ERROR a cycle occurred during layout computation
 | 
						|
 | 
						|
fn indirect<T: Trait>() {
 | 
						|
    abi::<T>(None);
 | 
						|
}
 | 
						|
 | 
						|
fn main() {
 | 
						|
    indirect::<()>();
 | 
						|
}
 |