Files
rust/compiler/rustc_traits
Jonathan Brouwer 9318843e0d Rollup merge of #161423 - Dnreikronos:trait_selection/preserve_type_op_constraints, r=BoxyUwU
trait_selection: Keep type-op region constraints in borrowck

I ran into this while working on rust-lang/rust#158588. `borrowck_env_fail` still had a FIXME because the function body wasn't reporting the outlives error. The next solver creates the region constraint, but the canonical type-op path doesn't put it in `QueryResponse`. Borrowck never sees it, so the type op looks fine and the error is lost.

With `-Zassumptions-on-binders`, these type ops now run locally on borrowck's `InferCtxt`. The fast path still runs first. That leaves the constraint in the same inference context borrowck reads later.

I prefer this over adding more data to the old canonical response. The next solver already caches its work, and teaching the old query path about these constraints felt like extra machinery for something we can avoid. Running locally is pretty boring, but I think that's a good thing here. The old FIXME is now the regression test.
2026-09-08 18:19:38 +02:00
..