diff options
| author | ltdk <usr@ltdk.xyz> | 2025-07-17 23:28:24 -0400 |
|---|---|---|
| committer | ltdk <usr@ltdk.xyz> | 2025-08-12 16:57:56 -0400 |
| commit | d6945f6d8c15bd692000cd7f8d76d171ae27b8c9 (patch) | |
| tree | 65fef144957515a790effa8afe8cb42df17a357b /library/alloc/src/vec/mod.rs | |
| parent | 8e62bfd311791bfd9dca886abdfbab07ec54d8b4 (diff) | |
| download | rust-d6945f6d8c15bd692000cd7f8d76d171ae27b8c9.tar.gz rust-d6945f6d8c15bd692000cd7f8d76d171ae27b8c9.zip | |
Add cast_init and cast_uninit methods for pointers
Diffstat (limited to 'library/alloc/src/vec/mod.rs')
| -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 8001faf9d20..2e40227a058 100644 --- a/library/alloc/src/vec/mod.rs +++ b/library/alloc/src/vec/mod.rs @@ -3176,7 +3176,7 @@ impl<T, A: Allocator> Vec<T, A> { // - but the allocation extends out to `self.buf.capacity()` elements, possibly // uninitialized let spare_ptr = unsafe { ptr.add(self.len) }; - let spare_ptr = spare_ptr.cast::<MaybeUninit<T>>(); + let spare_ptr = spare_ptr.cast_uninit(); let spare_len = self.buf.capacity() - self.len; // SAFETY: |
