Skip to content

Commit

Permalink
Rollup merge of rust-lang#127422 - greaka:master, r=workingjubilee
Browse files Browse the repository at this point in the history
as_simd: fix doc comment to be in line with align_to

In rust-lang#121201, the guarantees about `align_offset` and `align_to` were changed. This PR aims to correct the doc comment of `as_simd` to be in line with the new `align_to`.

Tagging rust-lang#86656 for good measure.
  • Loading branch information
matthiaskrgr authored Jul 12, 2024
2 parents f937ef1 + 0907955 commit 20bfac6
Showing 1 changed file with 4 additions and 22 deletions.
26 changes: 4 additions & 22 deletions core/src/slice/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3959,17 +3959,8 @@ impl<T> [T] {

/// Split a slice into a prefix, a middle of aligned SIMD types, and a suffix.
///
/// This is a safe wrapper around [`slice::align_to`], so has the same weak
/// postconditions as that method. You're only assured that
/// `self.len() == prefix.len() + middle.len() * LANES + suffix.len()`.
///
/// Notably, all of the following are possible:
/// - `prefix.len() >= LANES`.
/// - `middle.is_empty()` despite `self.len() >= 3 * LANES`.
/// - `suffix.len() >= LANES`.
///
/// That said, this is a safe method, so if you're only writing safe code,
/// then this can at most cause incorrect logic, not unsoundness.
/// This is a safe wrapper around [`slice::align_to`], so inherits the same
/// guarantees as that method.
///
/// # Panics
///
Expand Down Expand Up @@ -4033,17 +4024,8 @@ impl<T> [T] {
/// Split a mutable slice into a mutable prefix, a middle of aligned SIMD types,
/// and a mutable suffix.
///
/// This is a safe wrapper around [`slice::align_to_mut`], so has the same weak
/// postconditions as that method. You're only assured that
/// `self.len() == prefix.len() + middle.len() * LANES + suffix.len()`.
///
/// Notably, all of the following are possible:
/// - `prefix.len() >= LANES`.
/// - `middle.is_empty()` despite `self.len() >= 3 * LANES`.
/// - `suffix.len() >= LANES`.
///
/// That said, this is a safe method, so if you're only writing safe code,
/// then this can at most cause incorrect logic, not unsoundness.
/// This is a safe wrapper around [`slice::align_to_mut`], so inherits the same
/// guarantees as that method.
///
/// This is the mutable version of [`slice::as_simd`]; see that for examples.
///
Expand Down

0 comments on commit 20bfac6

Please sign in to comment.