//@ build-fail //~^ ERROR: a cycle occurred during layout computation //~| ERROR: cycle detected when computing layout of // Issue #111176 -- ensure that we do not emit ICE on layout cycles use std::mem; pub struct S { pub f: ::I, } pub trait Tr { type I: Tr; } impl Tr for S { type I = S>; } impl Tr for () { type I = (); } fn foo() -> usize { mem::size_of::>() } fn main() { println!("{}", foo::>()); }