trait solver: Track canonical response universe assumptions - #159987
trait solver: Track canonical response universe assumptions#159987Dnreikronos wants to merge 2 commits into
Conversation
|
r? @nnethercote rustbot has assigned @nnethercote. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
8402992 to
53bab87
Compare
This comment has been minimized.
This comment has been minimized.
Canonical responses can return query-created placeholders through opaque type constraints. Record empty assumptions when recreating those universes in the caller so eager placeholder handling does not ICE.
53bab87 to
698320c
Compare
|
r? types |
|
r? @lcnr |
|
r? BoxyUwU |
|
|
|
Handling opaques here is interesting :/ I guess this might be fine as a temporary hack, I've been chatting about this with Boxy before and rust-lang/trait-system-refactor-initiative#271 partially removes the need for this, but to fully remove it will take a while probably |
|
we should at least have a FIXME here I think |
|
Added the FIXME, fyi. imo this workaround is a bit gross, but I think the damage is fairly limited here because the query already handles the region constraints. The annoying bit is that opaque type constraints can still carry query-created placeholders back out through the canonical response, so the recreated universes still need an assumptions entry. idk if trying to compute more precise assumptions here is worth doing asap. The irl fix seems closer to the opaque storage work in rust-lang/trait-system-refactor-initiative#271, so I left this as an empty-assumptions temporary hack for now. btw ltm if you want the FIXME to point at that issue directly. |
Fixes #159889
Canonical responses recreate universes for placeholders created while evaluating a query. Region constraints are handled inside the query, but opaque type constraints can still carry those placeholders back to the caller. Without an assumptions entry, eager placeholder handling hits the
unwrap()inget_placeholder_assumptions.Record empty assumptions when recreating response universes under
-Zassumptions-on-binders. idk if empty assumptions is the final shape irl, but imo keeping this next tocreate_next_universeis the right local fix. It restores the invariant where the universe enters the caller and matches bookkeeping from other binder entry paths. fyi the issue repro now reports E0277 instead of ICEing.