mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-10-31 04:57:19 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			18 lines
		
	
	
		
			580 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			18 lines
		
	
	
		
			580 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
| //~ ERROR cycle detected when computing layout of `core::option::Option<S>`
 | |
| //~| NOTE ...which requires computing layout of `S`...
 | |
| //~| NOTE ...which requires computing layout of `core::option::Option<<S as Mirror>::It>`...
 | |
| //~| NOTE ...which again requires computing layout of `core::option::Option<S>`, completing the cycle
 | |
| //~| NOTE cycle used when computing layout of `core::option::Option<<S as Mirror>::It>`
 | |
| 
 | |
| trait Mirror {
 | |
|     type It: ?Sized;
 | |
| }
 | |
| impl<T: ?Sized> Mirror for T {
 | |
|     type It = Self;
 | |
| }
 | |
| struct S(Option<<S as Mirror>::It>);
 | |
| 
 | |
| fn main() {
 | |
|     let _s = S(None);
 | |
| }
 | 
