diff options
Diffstat (limited to 'vendor/zerovec/src/zerovec/mod.rs')
-rw-r--r-- | vendor/zerovec/src/zerovec/mod.rs | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/vendor/zerovec/src/zerovec/mod.rs b/vendor/zerovec/src/zerovec/mod.rs index e0876338f..371450e21 100644 --- a/vendor/zerovec/src/zerovec/mod.rs +++ b/vendor/zerovec/src/zerovec/mod.rs @@ -22,7 +22,7 @@ use core::marker::PhantomData; use core::mem; use core::ops::Deref; -/// A zero-copy vector for fixed-width types. +/// A zero-copy, byte-aligned vector for fixed-width types. /// /// `ZeroVec<T>` is designed as a drop-in replacement for `Vec<T>` in situations where it is /// desirable to borrow data from an unaligned byte slice, such as zero-copy deserialization. @@ -352,11 +352,6 @@ where /// `bytes` need to be an output from [`ZeroSlice::as_bytes()`]. pub const unsafe fn from_bytes_unchecked(bytes: &'a [u8]) -> Self { // &[u8] and &[T::ULE] are the same slice with different length metadata. - /// core::slice::from_raw_parts(a, b) = core::mem::transmute((a, b)) hack - /// ```compile_fail - /// const unsafe fn canary() { core::slice::from_raw_parts(0 as *const u8, 0); } - /// ``` - const _: () = (); Self::new_borrowed(core::mem::transmute(( bytes.as_ptr(), bytes.len() / core::mem::size_of::<T::ULE>(), |