-
Notifications
You must be signed in to change notification settings - Fork 13.6k
compute_trait_goal
structural equality fast path
#144258
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 |
@ors2 try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
.any(|p| p == goal.predicate) | ||
{ | ||
let candidate = self | ||
.probe_trait_candidate(CandidateSource::ParamEnv(ParamEnvSource::NonGlobal)) |
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.
TODO: this incorrect marks param_env candidates as global :<
//@[next] compile-flags: -Znext-solver | ||
//@[next] known-bug: #92505 | ||
//@[current] check-pass | ||
//@ check-pass |
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.
TODO: I don't fully get why this one compiles now 🤔
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.
we've got the proof tree
T: Trait
- via env:
AliasRelate(T::Assoc, T)
no solutionNormalizesTo(T::Assoc)
- compute proven_via for
T: Trait
- via
AliasRelate(T::Assoc, T)
unproductive cycle - via impl ->
T
- via
- compute proven_via for
- via env:
we currently never try to actually normalize T::Assoc
outside of applying the param env candidate. Doing this has the following proof tree
NormalizesTo(T::Assoc)
- compute proven_via for
T: Trait
- via
AliasRelate(T::Assoc, T)
errNormalizesTo(T::Assoc)
unproductive cycle no solution
- via impl ->
T
- via
- compute proven_via for
- cycle rerun (provisional result: normalizes-to
T
)- compute proven_via for
T: Trait
- via
AliasRelate(T::Assoc, T)
okNormalizesTo(T::Assoc)
cycle provisional resultT
- via
- alias is rigid
- compute proven_via for
- cycle rerun (provisional result: normalizes-to
T::Assoc
)- compute proven_via for
T: Trait
- via
AliasRelate(T::Assoc, T)
errNormalizesTo(T::Assoc)
cycle provisional resultT::Assoc
- via
- via impl ->
T
- compute proven_via for
- ...fail to reach fixpoint
This should start failing again with #140558 and changes it's behavior as this PR simply causes checking whether the <T as Trait>::Assoc: Trait
to use the fast path instead of normalizing the self type
@bors2 try |
`compute_trait_goal` structural equality fast path Fixes the hang in rayon and rust-lang/trait-system-refactor-initiative#210. This changes means we now have a far stronger reliance on structural equality making rust-lang/trait-system-refactor-initiative#127 a significantly larger problem. However, I've come to believe that fast paths based on structural equality are just too desirable. Fixes #139409. r? `@compiler-errors`
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (2f05b1f): comparison URL. Overall result: ✅ improvements - no action neededBenchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf. @bors rollup=never Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (secondary -3.9%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary -2.2%, secondary -3.3%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 465.321s -> 462.652s (-0.57%) |
Fixes the hang in rayon and rust-lang/trait-system-refactor-initiative#210.
This changes means we now have a far stronger reliance on structural identity making rust-lang/trait-system-refactor-initiative#127 a significantly larger problem. However, I've come to believe that fast paths based on structural equality are just too desirable. Solves that issue by uniquifying root goals only during HIR typeck. Fixes github.com/rust-lang/trait-system-refactor-initiative/issues/27
Fixes #139409.
r? @compiler-errors