-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Fix implied outlives bounds logic for projections #101680
Conversation
@bors try |
⌛ Trying commit 79367191d3c2148648e4167e4e366a538c2f7650 with merge 77b749d3ae4f115e3b8cef8a0e20da0998461320... |
This comment has been minimized.
This comment has been minimized.
💔 Test failed - checks-actions |
Spurious? @bors try |
⌛ Trying commit 79367191d3c2148648e4167e4e366a538c2f7650 with merge d752302224558bd75a97bd19853f642147a9d13b... |
💔 Test failed - checks-actions |
This comment has been minimized.
This comment has been minimized.
7936719
to
f8f8a50
Compare
@bors try |
⌛ Trying commit f8f8a50 with merge ee93ebe8ef8a3e16bffdd473f324fc515dec2948... |
💔 Test failed - checks-actions |
This comment has been minimized.
This comment has been minimized.
@bors try |
⌛ Trying commit 9e6234b294bc5aae0b6fcf8d7b0a73e55459d67d with merge e79c9799a5ffd821c63b799b91e8aa87fd7ebb1e... |
This comment has been minimized.
This comment has been minimized.
☀️ Try build successful - checks-actions |
@craterbot check |
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
let param_env = self.param_env; | ||
self.add_outlives_bounds(outlives::explicit_outlives_bounds(param_env)); | ||
|
||
// Finally: |
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.
"Finally:" seems wrong, considering that we add the implied bounds further down 😁
// We add implied bounds from both the unnormalized and normalized ty. | ||
// See issue #87748 | ||
let constraints_unnorm = self.add_implied_bounds(ty); | ||
constraints_unnorm.map(|c| constraints.push(c)); |
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.
can you use if let
here? map with side effects always looks a bit scary to me
@@ -918,6 +918,8 @@ pub(crate) struct MirTypeckRegionConstraints<'tcx> { | |||
} | |||
|
|||
impl<'tcx> MirTypeckRegionConstraints<'tcx> { | |||
/// Creates a `Region` that for a given `PlaceholderRegion`, or returns the |
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.
"Creates a Region
that for a given PlaceholderRegion
"?
Switching to waiting on author to incorporate last changes (see comment) then we should be set. @rustbot author |
b3b3530
to
449824e
Compare
Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
Some changes occurred in src/tools/cargo cc @ehuss |
22a8dae
to
40e519e
Compare
…hind normalization
40e519e
to
0637b6b
Compare
@bors r=lcnr rollup=never |
☀️ Test successful - checks-actions |
Finished benchmarking commit (a697573): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis 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.
CyclesResultsThis 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.
|
The logic here is subtly wrong. I put a bit of an explanation in a767d7b5165cea8ee5cbe494a4a636c50ef67c9c.
TL;DR: we register outlives predicates to be proved, because wf code normalizes projections (from the unnormalized types) to type variables. This causes us to register those as constraints instead of implied. This was "fine", because we later added that implied bound in the normalized type, and delayed registering constraints. When I went to cleanup
free_region_relations
to not delay adding constraints, this bug was uncovered.cc. @aliemjay because this caused your test failure in #99832 (I only realized as I was writing this)
r? @nikomatsakis