-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Only prefer param-env candidates if they remain non-global after norm #140260
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?
Only prefer param-env candidates if they remain non-global after norm #140260
Conversation
HIR ty lowering was modified cc @fmease Some changes occurred to the core trait solver cc @rust-lang/initiative-trait-system-refactor Some changes occurred in src/tools/clippy cc @rust-lang/clippy |
574fcaa
to
a154981
Compare
The job Click to see the possible cause of the failure (guessed by this bot)
|
.any(|c| { | ||
matches!( | ||
c.source, | ||
CandidateSource::ParamEnv(_) | CandidateSource::GlobalParamEnv(_) |
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.
vibe: bool on CandidateSource::ParamEnv
seems nicer
pls add test trait With {
type Assoc;
}
impl<T> With for T {
type Assoc = T;
}
trait Incomplete<T> {}
impl<T> Incomplete<T> for () {}
fn impls_incomplete<T: Incomplete<U>, U>() {}
fn foo<T>()
where
u32: With<Assoc = T>,
(): Incomplete<<u32 as With>::Assoc>,
{
impls_incomplete::<(), _>();
}
fn main() {} edit: actually, added as part of #140313 |
☔ The latest upstream changes (presumably #140324) made this pull request unmergeable. Please resolve the merge conflicts. |
Introduce
CandidateSource::GlobalParamEnv
, and dynamically compute theCandidateSource
based on whether the predicate contains params post-normalization.This code needs some cleanup and documentation. I'm just putting this up for review.
cc rust-lang/trait-system-refactor-initiative#179
r? lcnr