diff options
| author | Urgau <urgau@numericable.fr> | 2024-02-10 17:55:17 +0100 |
|---|---|---|
| committer | Urgau <urgau@numericable.fr> | 2025-04-20 11:36:28 +0200 |
| commit | 40ba47d3b0d53374c9170871f82a410e632fe1e3 (patch) | |
| tree | 84f07b87673ce9fce4c75cefde5950cbbee7f3c3 /library/alloc/src/vec | |
| parent | 1632f624fbcda1a3134ca4946af75e116c143261 (diff) | |
| download | rust-40ba47d3b0d53374c9170871f82a410e632fe1e3.tar.gz rust-40ba47d3b0d53374c9170871f82a410e632fe1e3.zip | |
Implement lint against dangerous implicit autorefs
Diffstat (limited to 'library/alloc/src/vec')
| -rw-r--r-- | library/alloc/src/vec/mod.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/library/alloc/src/vec/mod.rs b/library/alloc/src/vec/mod.rs index 68e4add30e5..65a83cb98ba 100644 --- a/library/alloc/src/vec/mod.rs +++ b/library/alloc/src/vec/mod.rs @@ -2588,7 +2588,7 @@ impl<T, A: Allocator> Vec<T, A> { #[inline] #[track_caller] unsafe fn append_elements(&mut self, other: *const [T]) { - let count = unsafe { (*other).len() }; + let count = other.len(); self.reserve(count); let len = self.len(); unsafe { ptr::copy_nonoverlapping(other as *const T, self.as_mut_ptr().add(len), count) }; |
