@@ -396,7 +396,7 @@ impl Fill for [u8] {
396
396
/// Implement `Fill` for given type `T`.
397
397
///
398
398
/// # Safety
399
- /// All representations of `[u8; size_of::<T>()]` are also representations of `T`.
399
+ /// All bit patterns of `[u8; size_of::<T>()]` represent values of `T`.
400
400
macro_rules! unsafe_impl_fill {
401
401
( ) => { } ;
402
402
( $t: ty) => {
@@ -405,7 +405,7 @@ macro_rules! unsafe_impl_fill {
405
405
if self . len( ) > 0 {
406
406
let size = mem:: size_of_val( self ) ;
407
407
rng. fill_bytes(
408
- // SAFETY: `self` is not borrowed and all byte sequences are representations of `T`.
408
+ // SAFETY: `self` is not borrowed and all byte sequences represent values of `T`.
409
409
unsafe {
410
410
slice:: from_raw_parts_mut( self . as_mut_ptr( )
411
411
as * mut u8 ,
@@ -425,7 +425,7 @@ macro_rules! unsafe_impl_fill {
425
425
if self . len( ) > 0 {
426
426
let size = self . len( ) * mem:: size_of:: <$t>( ) ;
427
427
rng. fill_bytes(
428
- // SAFETY: `self` is not borrowed and all byte sequences are representations of `T`.
428
+ // SAFETY: `self` is not borrowed and all byte sequences represent values of `T`.
429
429
unsafe {
430
430
slice:: from_raw_parts_mut( self . as_mut_ptr( )
431
431
as * mut u8 ,
@@ -448,9 +448,9 @@ macro_rules! unsafe_impl_fill {
448
448
}
449
449
}
450
450
451
- // SAFETY: All representations of `[u8; size_of::<u* >()]` are representations of `u*`.
451
+ // SAFETY: All bit patterns of `[u8; size_of::<T >()]` represent values of `u*`.
452
452
unsafe_impl_fill ! ( u16 , u32 , u64 , u128 , ) ;
453
- // SAFETY: All representations of `[u8; size_of::<i* >()]` are representations of `i*`.
453
+ // SAFETY: All bit patterns of `[u8; size_of::<T >()]` represent values of `i*`.
454
454
unsafe_impl_fill ! ( i8 , i16 , i32 , i64 , i128 , ) ;
455
455
456
456
impl < T , const N : usize > Fill for [ T ; N ]
0 commit comments