about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMaybe Waffle <waffle.lapkin@gmail.com>2022-10-21 15:29:02 +0000
committerMaybe Waffle <waffle.lapkin@gmail.com>2022-10-21 15:29:02 +0000
commite97d295d0078b03212cecb91854b979e4757ba72 (patch)
tree4e220bb48e4aedcd24d13079147d21e07b49a79e
parent2a9217601c0e5ae83fa8bca6797137a6d2f7e4e5 (diff)
downloadrust-e97d295d0078b03212cecb91854b979e4757ba72.tar.gz
rust-e97d295d0078b03212cecb91854b979e4757ba72.zip
Remove incorrect comment in `Vec::drain`
-rw-r--r--library/alloc/src/vec/mod.rs4
1 files changed, 1 insertions, 3 deletions
diff --git a/library/alloc/src/vec/mod.rs b/library/alloc/src/vec/mod.rs
index b2bb7a5b2e6..240d2838ab5 100644
--- a/library/alloc/src/vec/mod.rs
+++ b/library/alloc/src/vec/mod.rs
@@ -1999,9 +1999,7 @@ impl<T, A: Allocator> Vec<T, A> {
         unsafe {
             // set self.vec length's to start, to be safe in case Drain is leaked
             self.set_len(start);
-            // Use the borrow in the IterMut to indicate borrowing behavior of the
-            // whole Drain iterator (like &mut T).
-            let range_slice = slice::from_raw_parts_mut(self.as_mut_ptr().add(start), end - start);
+            let range_slice = slice::from_raw_parts(self.as_ptr().add(start), end - start);
             Drain {
                 tail_start: end,
                 tail_len: len - end,