File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -96,7 +96,8 @@ macro_rules! compress {
9696/// `copy_nonoverlapping` to let the compiler generate the most efficient way
9797/// to load it from a possibly unaligned address.
9898///
99- /// Unsafe because: unchecked indexing at i..i+size_of(int_ty)
99+ /// Safety: this performs unchecked indexing of `$buf` at
100+ /// `$i..$i+size_of::<$int_ty>()`, so that must be in-bounds.
100101macro_rules! load_int_le {
101102 ( $buf: expr, $i: expr, $int_ty: ident) => { {
102103 debug_assert!( $i + mem:: size_of:: <$int_ty>( ) <= $buf. len( ) ) ;
@@ -114,7 +115,8 @@ macro_rules! load_int_le {
114115/// `copy_nonoverlapping` calls that occur (via `load_int_le!`) all have fixed
115116/// sizes and avoid calling `memcpy`, which is good for speed.
116117///
117- /// Unsafe because: unchecked indexing at start..start+len
118+ /// Safety: this performs unchecked indexing of `buf` at `start..start+len`, so
119+ /// that must be in-bounds.
118120#[ inline]
119121unsafe fn u8to64_le ( buf : & [ u8 ] , start : usize , len : usize ) -> u64 {
120122 debug_assert ! ( len < 8 ) ;
You can’t perform that action at this time.
0 commit comments