//@ revisions: current next //@ ignore-compare-mode-next-solver (explicit revisions) //@[next] compile-flags: -Znext-solver // A variation of #135246 where the cyclic bounds are part of // the impl instead of the impl associated item. trait Trait: Sized { type Proof: Trait; } // We need to use indirection here as we otherwise normalize // `>::Proof` before recursing into // `R: Trait>::Proof>`. trait Indir, R>: Trait>::Proof> {} impl Indir for R where L: Trait, R: Trait>::Proof>, {} impl Trait for L where L: Trait, R: Indir, { type Proof = R; } fn transmute, R>(r: L) -> >::Proof { r } fn main() { let s: String = transmute::<_, String>(vec![65_u8, 66, 67]); //~^ ERROR overflow evaluating the requirement `Vec: Trait` //[next]~| ERROR overflow evaluating the requirement `< as Trait>::Proof as Trait>::Proof == _` //[next]~| ERROR overflow evaluating the requirement `< as Trait>::Proof as Trait>::Proof == String` //[next]~| ERROR overflow evaluating the requirement `< as Trait>::Proof as Trait>::Proof: Sized` //[next]~| ERROR overflow evaluating the requirement `< as Trait>::Proof as Trait>::Proof well-formed` //[next]~| ERROR overflow evaluating the requirement `< as Trait>::Proof as Trait>::Proof == _` println!("{}", s); // ABC }