Rollup merge of #103359 - WaffleLapkin:drain_no_mut_qqq, r=scottmcm
Remove incorrect comment in `Vec::drain` r? ``@scottmcm`` Turns out this comment wasn't correct for 6 years, since #34951, which switched from using `slice::IterMut` into using `slice::Iter`.
This commit is contained in:
commit
1b2f594f48
@ -1999,9 +1999,7 @@ impl<T, A: Allocator> Vec<T, A> {
|
|||||||
unsafe {
|
unsafe {
|
||||||
// set self.vec length's to start, to be safe in case Drain is leaked
|
// set self.vec length's to start, to be safe in case Drain is leaked
|
||||||
self.set_len(start);
|
self.set_len(start);
|
||||||
// Use the borrow in the IterMut to indicate borrowing behavior of the
|
let range_slice = slice::from_raw_parts(self.as_ptr().add(start), end - start);
|
||||||
// whole Drain iterator (like &mut T).
|
|
||||||
let range_slice = slice::from_raw_parts_mut(self.as_mut_ptr().add(start), end - start);
|
|
||||||
Drain {
|
Drain {
|
||||||
tail_start: end,
|
tail_start: end,
|
||||||
tail_len: len - end,
|
tail_len: len - end,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user