don't ice on non-lifetime binders under -Zassumptions-on-binders#157807
don't ice on non-lifetime binders under -Zassumptions-on-binders#157807Dnreikronos wants to merge 2 commits into
-Zassumptions-on-binders#157807Conversation
The region-constraint machinery for `-Zassumptions-on-binders` is region-outlives-only. A non-lifetime binder (`for<T>`) introduces a placeholder type in the binder's universe `u`. The rewrite that pulls constraints out of `u` only folds regions (`PlaceholderReplacer` just implements `fold_region`), so an alias-outlives constraint such as `<!T as Trait>::Assoc: 'r` reaches `pull_region_outlives_constraints_out_of_universe` still in `u` and trips `assert!(max_universe < u)`. Report ambiguity for those constraints instead of asserting, matching the existing `None => Ambiguity` bail-outs in this module. The goal then surfaces as an ordinary ambiguity error rather than an ICE.
|
r? BoxyUwU |
|
can you move this logic into |
|
done, moved this into
idk if this is the exact shape you had in mind, but lgtm locally. imp bit is that |
fixes #157778
w/
-Znext-solver=globally -Zassumptions-on-bindersand a non-lifetime binder we hitassert!(max_universe < u)inpull_region_outlives_constraints_out_of_universeand ICE.the machinery here is region-outlives only, but a
for<T>binder leaves a placeholder type in universeuthat the region-only rewrite can't pull out, so an alias outlives like<!T as Trait>::Assoc: 'rreaches that assert still inu. just report ambiguity in that case, same as theNone => Ambiguitybails right next to it — now it errors normally (E0284) instead of ICEing.r? @lcnr