Add check that live_region is live in sanitize_promoted#88698
Add check that live_region is live in sanitize_promoted#88698bors merged 1 commit intorust-lang:masterfrom
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 |
There was a problem hiding this comment.
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🙂 |
nikomatsakis
left a comment
There was a problem hiding this comment.
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_promotedto ensure that only regions which are actually live are added to theliveness_constraintsof theBorrowCheckContext.To implement this change, I needed to add a method to
LivenessValueswhich 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_constraintsof 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.