Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

std::vec::IntoIter::as_mut_slice borrows &self, returns &mut of contents. #39465

Closed
christophebiocca opened this issue Feb 2, 2017 · 2 comments
Labels
I-unsound Issue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/Soundness T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@christophebiocca
Copy link
Contributor

/u/dbaupp on reddit points out that this method can be called multiple times and result in getting multiple &mut [T] of the exact same data.

@steveklabnik steveklabnik added A-libs I-unsound Issue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/Soundness T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Feb 2, 2017
@brson
Copy link
Contributor

brson commented Feb 2, 2017

Awesome!

@brson
Copy link
Contributor

brson commented Feb 2, 2017

I suggest we change it to &mut and run it through crater to see the impact. We can change it or immediately deprecate it. We can make a point release or wait until 1.16.

alexcrichton added a commit to alexcrichton/rust that referenced this issue Feb 2, 2017
This was intended to require `&mut self`, not `&self`, otherwise it's unsound!

Closes rust-lang#39465
bors added a commit that referenced this issue Feb 3, 2017
std: Fix IntoIter::as_mut_slice's signature

This was intended to require `&mut self`, not `&self`, otherwise it's unsound!

Closes #39465
alexcrichton added a commit to alexcrichton/rust that referenced this issue Feb 3, 2017
This was intended to require `&mut self`, not `&self`, otherwise it's unsound!

Closes rust-lang#39465
brson pushed a commit to brson/rust that referenced this issue Feb 4, 2017
This was intended to require `&mut self`, not `&self`, otherwise it's unsound!

Closes rust-lang#39465
brson pushed a commit to brson/rust that referenced this issue Feb 4, 2017
This was intended to require `&mut self`, not `&self`, otherwise it's unsound!

Closes rust-lang#39465
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
I-unsound Issue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/Soundness T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants