Skip to content
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 VecDeque::iter_mut aliasing issues #76911

Merged
merged 4 commits into from
Oct 7, 2020

Conversation

RalfJung
Copy link
Member

Fixes #74029

@rust-highfive
Copy link
Collaborator

r? @LukasKalbertodt

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 19, 2020
@RalfJung
Copy link
Member Author

@KodrAus maybe you could help review this?

@bors
Copy link
Contributor

bors commented Oct 5, 2020

☔ The latest upstream changes (presumably #77557) made this pull request unmergeable. Please resolve the merge conflicts.

Note that reviewers usually do not review pull requests until merge conflicts are resolved! Once you resolve the conflicts, you should change the labels applied by bors to indicate that your PR is ready for review. Post this as a comment to change the labels:

@rustbot modify labels: +S-waiting-on-review -S-waiting-on-author

@RalfJung
Copy link
Member Author

RalfJung commented Oct 5, 2020

@rust-lang/compiler this PR needs a reviewer :) The first two seem to be busy.

@oli-obk
Copy link
Contributor

oli-obk commented Oct 5, 2020

r? @oli-obk

@@ -1175,6 +1183,7 @@ impl<T> VecDeque<T> {
head,
// The shared reference we have in &mut self is maintained in the '_ of IterMut.
ring: unsafe { self.buffer_as_mut_slice() },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same "no need for unsafe or reference" change applies here, too

@oli-obk
Copy link
Contributor

oli-obk commented Oct 6, 2020

r=me with the second ring field creation updated, too

@RalfJung
Copy link
Member Author

RalfJung commented Oct 6, 2020

Good catch!

@bors r=oli-obk

@bors
Copy link
Contributor

bors commented Oct 6, 2020

📌 Commit 242b2b95f9919aa5bf9a8259eb65071576d91981 has been approved by oli-obk

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 6, 2020
@RalfJung
Copy link
Member Author

RalfJung commented Oct 6, 2020

@bors rollup

@RalfJung
Copy link
Member Author

RalfJung commented Oct 6, 2020

@bors r-
CI failure

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Oct 6, 2020
@RalfJung
Copy link
Member Author

RalfJung commented Oct 6, 2020

ran rustfmt
@bors r=oli-obk

@bors
Copy link
Contributor

bors commented Oct 6, 2020

📌 Commit fa6a4f7 has been approved by oli-obk

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 6, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 6, 2020
Rollup of 11 pull requests

Successful merges:

 - rust-lang#76784 (Add some docs to rustdoc::clean::inline and def_id functions)
 - rust-lang#76911 (fix VecDeque::iter_mut aliasing issues)
 - rust-lang#77400 (Fix suggestions for x.py setup)
 - rust-lang#77515 (Update to chalk 0.31)
 - rust-lang#77568 (inliner: use caller param_env)
 - rust-lang#77571 (Use matches! for core::char methods)
 - rust-lang#77582 (Move `EarlyOtherwiseBranch` to mir-opt-level 2)
 - rust-lang#77590 (Update RLS and Rustfmt)
 - rust-lang#77605 (Fix rustc_def_path to show the full path and not the trimmed one)
 - rust-lang#77614 (Let backends access span information)
 - rust-lang#77624 (Add c as a shorthand check alternative for new options rust-lang#77603)

Failed merges:

r? `@ghost`
@bors bors merged commit 5ae45ea into rust-lang:master Oct 7, 2020
@rustbot rustbot added this to the 1.49.0 milestone Oct 7, 2020
@RalfJung RalfJung deleted the vecdeque-aliasing branch October 7, 2020 07:00
bors added a commit to rust-lang/miri that referenced this pull request Oct 7, 2020
test VecDeque::iter_mut aliasing

Blocked on rust-lang/rust#76911
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

VecDeque::iter_mut tramples on the references it returned earlier
6 participants