// Regression test for issue #83538. The problem here is that we have // two cycles: // // * `Ty` embeds `Box` indirectly, which depends on `Global: 'static`, which is OkModuloRegions. // * But `Ty` also references `First`, which has a cycle on itself. That should just be `Ok`. // // But our caching mechanism was blending both cycles and giving the incorrect result. #![feature(rustc_attrs)] #![allow(bad_style)] struct First { b: Vec, } pub struct Second { d: Vec, } struct Third { g: Vec, } enum Ty { j(Fourth, Fifth, Sixth), } struct Fourth { o: Vec, } struct Fifth { bounds: First, } struct Sixth { p: Box, } #[rustc_evaluate_where_clauses] fn forward() where Vec: Unpin, Third: Unpin, { } #[rustc_evaluate_where_clauses] fn reverse() where Third: Unpin, Vec: Unpin, { } fn main() { // Key is that Vec is "ok" and Third is "ok modulo regions": forward(); //~^ ERROR evaluate(Binder(TraitPredicate( as std::marker::Unpin>), [])) = Ok(EvaluatedToOk) //~| ERROR evaluate(Binder(TraitPredicate( as std::marker::Unpin>), [])) = Ok(EvaluatedToOkModuloRegions) reverse(); //~^ ERROR evaluate(Binder(TraitPredicate( as std::marker::Unpin>), [])) = Ok(EvaluatedToOk) //~| ERROR evaluate(Binder(TraitPredicate( as std::marker::Unpin>), [])) = Ok(EvaluatedToOkModuloRegions) }