File tree 1 file changed +4
-2
lines changed
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -96,7 +96,8 @@ macro_rules! compress {
96
96
/// `copy_nonoverlapping` to let the compiler generate the most efficient way
97
97
/// to load it from a possibly unaligned address.
98
98
///
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.
100
101
macro_rules! load_int_le {
101
102
( $buf: expr, $i: expr, $int_ty: ident) => { {
102
103
debug_assert!( $i + mem:: size_of:: <$int_ty>( ) <= $buf. len( ) ) ;
@@ -114,7 +115,8 @@ macro_rules! load_int_le {
114
115
/// `copy_nonoverlapping` calls that occur (via `load_int_le!`) all have fixed
115
116
/// sizes and avoid calling `memcpy`, which is good for speed.
116
117
///
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.
118
120
#[ inline]
119
121
unsafe fn u8to64_le ( buf : & [ u8 ] , start : usize , len : usize ) -> u64 {
120
122
debug_assert ! ( len < 8 ) ;
You can’t perform that action at this time.
0 commit comments