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

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

Closed
christophebiocca opened this Issue Feb 2, 2017 · 2 comments

Comments

Projects
None yet
3 participants
@christophebiocca
Copy link
Contributor

christophebiocca commented Feb 2, 2017

/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.

@brson

This comment has been minimized.

Copy link
Contributor

brson commented Feb 2, 2017

Awesome!

@brson

This comment has been minimized.

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

std: Fix IntoIter::as_mut_slice's signature
This was intended to require `&mut self`, not `&self`, otherwise it's unsound!

Closes rust-lang#39465

alexcrichton added a commit to alexcrichton/rust that referenced this issue Feb 2, 2017

std: Fix IntoIter::as_mut_slice's signature
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

Auto merge of #39466 - alexcrichton:fix, r=Manishearth
std: Fix IntoIter::as_mut_slice's signature

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

Closes #39465

@bors bors closed this in #39466 Feb 3, 2017

king6cong added a commit to king6cong/rust 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 rust-lang#39465

alexcrichton added a commit to alexcrichton/rust 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 rust-lang#39465

brson added a commit to brson/rust that referenced this issue Feb 4, 2017

std: Fix IntoIter::as_mut_slice's signature
This was intended to require `&mut self`, not `&self`, otherwise it's unsound!

Closes rust-lang#39465

brson added a commit to brson/rust that referenced this issue Feb 4, 2017

std: Fix IntoIter::as_mut_slice's signature
This was intended to require `&mut self`, not `&self`, otherwise it's unsound!

Closes rust-lang#39465
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.