mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-10-31 13:04:42 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			25 lines
		
	
	
		
			355 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
		
			355 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
| //@ build-fail
 | |
| //~^ ERROR 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>>) {}
 | |
| 
 | |
| fn indirect<T: Trait>() {
 | |
|     abi::<T>(None);
 | |
| }
 | |
| 
 | |
| fn main() {
 | |
|     indirect::<()>();
 | |
| }
 | 
