-
Notifications
You must be signed in to change notification settings - Fork 13k
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 universes in the NLL type tests #98109
Conversation
@bors try |
⌛ Trying commit 54d4fee2b42bbaa0073f89a7b979ed1cbb34f34b with merge 363598f22faa9d0e3a12f5b6d2b118bc77f83bf7... |
marking this as experimental since it probably shouldn't be merged, since it breaks existing UI tests |
|
||
return self.eval_outlives(sup_region, self.universal_regions.fr_static); | ||
} | ||
|
||
// Both the `sub_region` and `sup_region` consist of the union | ||
// of some number of universal regions (along with the union | ||
// of various points in the CFG; ignore those points for |
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.
I'm curious if the logic below (let universal_outlives = ...
) is necessary due to the added logic above. I don't know enough about borrowck to make a judgement.
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.
I believe it is still relevant. I think that the code below is meant to deal with "top-level" generics declared on the function, where we do have finer-grained outlives data.
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.
In other words, it deals with relationships between universals and variables that are in the same universe.
This comment has been minimized.
This comment has been minimized.
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment was marked as outdated.
This comment was marked as outdated.
cfd13a9
to
9c863ee
Compare
the excessive generality becomes annoying later because it wouldn't implement type folding etc
we don't really take other things
The code now accepts `Binder<OutlivesPredicate>` instead of just `OutlivesPredicate` and thus exercises the new, generalized `IfEqBound` codepaths. Note though that we never *produce* Binder<OutlivesPredicate>, so we are only testing a subset of those codepaths that excludes actual higher-ranked outlives bounds.
9c62a87
to
d6b3473
Compare
// Test that we consider `for<'a> &'a T: 'a` to be sufficient to prove | ||
// that `for<'a> &'a T: 'a`. | ||
// | ||
// FIXME. Except we don't! |
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.
known-bug?
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.
I believe so, certainly a pre-existing one. This feels like an implied bounds situation to me. We ought to be able to know that for<'a> &'a T: 'a
is really for<'a> if (WF(&'a T)) { &'a T: 'a }
, and -- in that case -- we would be succesful here.
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.
I think @jackh726 means using the // known-bug
attribute
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.
Ah, cool. Citing which bug?
This comment has been minimized.
This comment has been minimized.
In the NLL code, we were not accommodating universes in the `type_test` logic. This led to issue 98095.
These were "fixed" as part of switching on NLL but seems to be due to another problem. Preliminary investigation suggests they are both PROBABLY "implied bounds" related.
d6b3473
to
b39ba21
Compare
Co-authored-by: Oli Scherer <github35764891676564198441@oli-obk.de>
This comment has been minimized.
This comment has been minimized.
Hat-tip: aliemjay
per aliemjay's suggestion
@bors r+ p=5 rollup=never We want this in before beta cut, since this fixes a stable-to-nightly unsound regression, caused by NLL stabilization. There are two known regressions here, but one requires GATs (unstable) and the other has an obvious fix (remove the I think the code here and adjacent would be a good candidate for a types team deep dive; this feels a bit ad-hoc to me, even if correct (but I have little personal context to the overall design of this logic). |
📌 Commit e7ed8fe has been approved by |
☀️ Test successful - checks-actions |
Finished benchmarking commit (d017d59): comparison url. Instruction count
Max RSS (memory usage)Results
CyclesResults
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. Next Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression Footnotes |
In diesel-check-full, the main regression is
the second one is entirely due to the logic in |
@oli-obk should we capture this in an issue? I think it's pretty likely that this regression will go unaddressed if we leave it in the comment here. |
This is a soundness fix, the additional checking is necessary for soundness. I don't believe the regression is directly addressable, even if we can do some improvements here. I'll open a PR for the binder skipping thing to see if it has any effect, but I don't think it'll be significant. |
Ok I think we can mark this as triaged then. @rustbot label: +perf-regression-triaged |
In the NLL code, we were not accommodating universes in the
type_test
logic.Fixes #98095.
r? @compiler-errors
This breaks some tests, however, so the purpose of this branch is more explanatory and perhaps to do a crater run.