-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Apply nested goals certainty to InspectGoals
for normalizes-to
#142127
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?
Apply nested goals certainty to InspectGoals
for normalizes-to
#142127
Conversation
Some changes occurred to the core trait solver cc @rust-lang/initiative-trait-system-refactor This PR changes a file inside |
9eb62ee
to
19be2d3
Compare
@@ -218,13 +220,39 @@ impl<'a, 'tcx> InspectCandidate<'a, 'tcx> { | |||
// building their proof tree, the expected term was unconstrained, but when | |||
// instantiating the candidate it is already constrained to the result of another | |||
// candidate. | |||
let proof_tree = infcx | |||
.probe(|_| infcx.evaluate_root_goal_raw(goal, GenerateProofTree::Yes, None).1); |
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.
Here's the major change. Instead of evaluating the goal in this probe and throwing away nested obligations, then later constraining the RHS, we now evaluate the goal, constrain the RHS, and evaluate nested obligations all together, and stash the resulting certainty.
Then later on where we used to constrain the RHS in the InspectGoal::new
constructor, we just apply that certainty.
@@ -1,14 +0,0 @@ | |||
//@ known-bug: #140571 |
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 test was coincidentally fixed, but not for a particularly good reason. It's properly fixed in #142126.
@bors2 try @rust-timer queue Even if perf is bad, we still definitely need to do this for proof trees not to be wrong. |
This comment has been minimized.
This comment has been minimized.
Apply nested goals certainty to `InspectGoals` for normalizes-to ...so that normalizes-to goals don't have `Certainty::Yes` even if they have nested goals which don't hold. r? lcnr
Blocking this on #142085 so that I can remove the hack it introduces for normalizes-to goals. |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (7cf36c7): comparison URL. Overall result: ✅ improvements - no action neededBenchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. @bors rollup=never Instruction countThis is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.
Max RSS (memory usage)Results (secondary 0.8%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 751.682s -> 751.844s (0.02%) |
...so that normalizes-to goals don't have
Certainty::Yes
even if they have nested goals which don't hold.r? lcnr