-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Don't build ParamEnv
and do trait solving in ItemCtxt
s when lowering IATs
#140247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
This PR changes a file inside HIR ty lowering was modified cc @fmease |
☔ The latest upstream changes (presumably #140388) made this pull request unmergeable. Please resolve the merge conflicts. |
3361c7d
to
34ce403
Compare
@bors r+ |
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#135562 (Add ignore value suggestion in closure body) - rust-lang#139635 (Finalize repeat expr inference behaviour with inferred repeat counts) - rust-lang#139668 (Handle regions equivalent to 'static in non_local_bounds) - rust-lang#140218 (HIR ty lowering: Clean up & refactor the lowering of type-relative paths) - rust-lang#140435 (use uX::from instead of _ as uX in non - const contexts) - rust-lang#141130 (rustc_on_unimplemented cleanups) - rust-lang#141286 (Querify `coroutine_hidden_types`) Failed merges: - rust-lang#140247 (Don't build `ParamEnv` and do trait solving in `ItemCtxt`s when lowering IATs) r? `@ghost` `@rustbot` modify labels: rollup
☔ The latest upstream changes (presumably #141396) made this pull request unmergeable. Please resolve the merge conflicts. |
aee1a22
to
701d3b8
Compare
I should probably update this to use DeepRejectCtxt and handle LTAs correctly like discussed at the all hands 🤔 I was just gonna do it in a followup PR but if I'm having to rebase and figure out new crashes tests then I may aswell just do it all now |
701d3b8
to
276daf2
Compare
276daf2
to
5867bb5
Compare
This comment has been minimized.
This comment has been minimized.
5867bb5
to
02b87a8
Compare
02b87a8
to
ccec360
Compare
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#135562 (Add ignore value suggestion in closure body) - rust-lang#139635 (Finalize repeat expr inference behaviour with inferred repeat counts) - rust-lang#139668 (Handle regions equivalent to 'static in non_local_bounds) - rust-lang#140218 (HIR ty lowering: Clean up & refactor the lowering of type-relative paths) - rust-lang#140435 (use uX::from instead of _ as uX in non - const contexts) - rust-lang#141130 (rustc_on_unimplemented cleanups) - rust-lang#141286 (Querify `coroutine_hidden_types`) Failed merges: - rust-lang#140247 (Don't build `ParamEnv` and do trait solving in `ItemCtxt`s when lowering IATs) r? `@ghost` `@rustbot` modify labels: rollup
7fae1aa
to
8f33b8f
Compare
☔ The latest upstream changes (presumably #141644) made this pull request unmergeable. Please resolve the merge conflicts. |
oh come on lol |
8f33b8f
to
8f2995c
Compare
if lhs == rhs { | ||
return true; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this fast path should be in types_may_unify_inner
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove
☔ The latest upstream changes (presumably #142483) made this pull request unmergeable. Please resolve the merge conflicts. |
8f2995c
to
9961747
Compare
f4e04a9
to
ae65625
Compare
// Test that we can resolve to the right IAT when the self type | ||
// contains a bound type. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Test that we can resolve to the right IAT when the self type | |
// contains a bound type. | |
// Test whether we can resolve to the right IAT when the self type | |
// contains a bound type. This should ideally use the second impl. |
@@ -0,0 +1,26 @@ | |||
#![feature(inherent_associated_types)] | |||
#![expect(incomplete_features)] | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// A behavior test showcasing that we do not normalize associated types when | |
// assembling IAT candidates. |
|
||
#![feature(inherent_associated_types)] | ||
#![expect(incomplete_features)] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment
#![expect(incomplete_features)] | ||
|
||
// Test that when we have an unnormalized projection we don't normalize it | ||
// to determine which IAT to resolve to. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
difference between this test and tests/ui/associated-inherent-types/candidate-with-alias-2.rs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nits, then r=me
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 useDeepRejectCtxt
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