-
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
Add check that live_region is live in sanitize_promoted #88698
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @wesleywiser (or someone else) soon. Please see the contribution instructions for more information. |
|
541ae34
to
c01a2e2
Compare
Apologies, I think I accidentally modified some submodules in my commit somehow, but I reverted and then reapplied my actual changes, so hopefully this should be fixed now. |
Yeah, it's easy to do that. Running |
= help: add `#![feature(const_fn_trait_bound)]` to the crate attributes to enable | ||
|
||
error[E0658]: panicking in constant functions is unstable | ||
--> $DIR/issue-88434-removal-index-should-be-less.rs:9:5 | ||
| | ||
LL | panic!() | ||
| ^^^^^^^^ | ||
| | ||
= note: see issue #51999 <https://github.com/rust-lang/rust/issues/51999> for more information | ||
= help: add `#![feature(const_panic)]` to the crate attributes to enable |
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.
Might be good to add these feature flags to the test to get any "real" errors.
@Noble-Mushtak If you change
to
then GitHub will automatically close the issue when this PR is merged. |
This comment has been minimized.
This comment has been minimized.
2b17103
to
49e6b58
Compare
r? @jackh726 or feel free to re-assign to someone more familiar with borrowck🙂 |
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.
Gave this a first read. I'd like @oli-obk to take a look.
2b17103
to
b2e1d5c
Compare
This comment has been minimized.
This comment has been minimized.
@bors r=nikomatsakis,oli-obk I want to dig into some (preexisting) things I saw while reviewing, but nothing that should block this change |
📌 Commit 8fc329f has been approved by |
⌛ Testing commit 8fc329f with merge 2044f12e4c5620666baf28d15401c194cedd02a0... |
💥 Test timed out |
@bors retry |
☀️ Test successful - checks-actions |
Finished benchmarking commit (0a56eb1): comparison url. Summary: This benchmark run did not return any relevant changes. If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression |
This pull request fixes #88434 by adding a check in
sanitize_promoted
to ensure that only regions which are actually live are added to theliveness_constraints
of theBorrowCheckContext
.To implement this change, I needed to add a method to
LivenessValues
which gets the elements contained by a region:Then, inside
sanitize_promoted
, we check whether the iterator returned by this method is non-empty to ensure that the region is actually live at at least one location before adding that region to theliveness_constraints
of theBorrowCheckContext
.This is my first pull request to the Rust repo, so any feedback on how I can improve this pull request or if there is a better way to fix this issue would be very appreciated.