Skip to content

Don't build ParamEnv and do trait solving in ItemCtxts when lowering IATs#140247

Merged
bors merged 5 commits intorust-lang:masterfrom
BoxyUwU:iats_no_query_cycles
Jun 19, 2025
Merged

Don't build ParamEnv and do trait solving in ItemCtxts when lowering IATs#140247
bors merged 5 commits intorust-lang:masterfrom
BoxyUwU:iats_no_query_cycles

Conversation

@BoxyUwU
Copy link
Copy Markdown
Member

@BoxyUwU BoxyUwU commented Apr 24, 2025

Fixes #108491

Fixes #125879
This was due to updating inhabited predicate stuff which I had to do to make constructing ADTs with IATs in fields not ICE

Fixes #136678 (but no test added, I don't rly care about weird IAT edge cases under GCE)
Fixes #138131

Avoids doing "fully correct" candidate selection for IATs during hir ty lowering when in item signatures as it almost always leads to a query cycle from trying to build a ParamEnv. I replaced it with a use DeepRejectCtxt which should be able to handle this kind of conservative "could these types unify" while in a context where we don't want to do type equality.

This is a relatively simple scheme and should be forwards compatible with doing something more complex/powerful.

I'm not really sure how this interacts with #126651, though I'm also not really sure its super important to support projecting IATs from IAT self types given we don't even support T::Assoc::Other for trait-associated types so didn't give much thought to how this might fit in with that.

r? @compiler-errors
cc @fmease

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

F-inherent_associated_types `#![feature(inherent_associated_types)]` S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

8 participants