@@ -206,7 +206,7 @@ where
206206 or : Self ,
207207 ) -> Self {
208208 let enable: Mask < isize , LANES > = enable & idxs. lanes_lt ( Simd :: splat ( slice. len ( ) ) ) ;
209- // SAFETY : We have masked-off out-of-bounds lanes.
209+ // Safety : We have masked-off out-of-bounds lanes.
210210 unsafe { Self :: gather_select_unchecked ( slice, enable, idxs, or) }
211211 }
212212
@@ -247,7 +247,7 @@ where
247247 let base_ptr = crate :: simd:: ptr:: SimdConstPtr :: splat ( slice. as_ptr ( ) ) ;
248248 // Ferris forgive me, I have done pointer arithmetic here.
249249 let ptrs = base_ptr. wrapping_add ( idxs) ;
250- // SAFETY : The ptrs have been bounds-masked to prevent memory-unsafe reads insha'allah
250+ // Safety : The ptrs have been bounds-masked to prevent memory-unsafe reads insha'allah
251251 unsafe { intrinsics:: simd_gather ( or, ptrs, enable. to_int ( ) ) }
252252 }
253253
@@ -299,7 +299,7 @@ where
299299 idxs : Simd < usize , LANES > ,
300300 ) {
301301 let enable: Mask < isize , LANES > = enable & idxs. lanes_lt ( Simd :: splat ( slice. len ( ) ) ) ;
302- // SAFETY : We have masked-off out-of-bounds lanes.
302+ // Safety : We have masked-off out-of-bounds lanes.
303303 unsafe { self . scatter_select_unchecked ( slice, enable, idxs) }
304304 }
305305
@@ -338,7 +338,7 @@ where
338338 enable : Mask < isize , LANES > ,
339339 idxs : Simd < usize , LANES > ,
340340 ) {
341- // SAFETY : This block works with *mut T derived from &mut 'a [T],
341+ // Safety : This block works with *mut T derived from &mut 'a [T],
342342 // which means it is delicate in Rust's borrowing model, circa 2021:
343343 // &mut 'a [T] asserts uniqueness, so deriving &'a [T] invalidates live *mut Ts!
344344 // Even though this block is largely safe methods, it must be exactly this way
@@ -518,7 +518,9 @@ mod sealed {
518518use sealed:: Sealed ;
519519
520520/// Marker trait for types that may be used as SIMD vector elements.
521- /// SAFETY: This trait, when implemented, asserts the compiler can monomorphize
521+ ///
522+ /// # Safety
523+ /// This trait, when implemented, asserts the compiler can monomorphize
522524/// `#[repr(simd)]` structs with the marked type as an element.
523525/// Strictly, it is valid to impl if the vector will not be miscompiled.
524526/// Practically, it is user-unfriendly to impl it if the vector won't compile,
0 commit comments