Skip to content

Commit

Permalink
Rollup merge of rust-lang#63293 - shepmaster:align-to-doc, r=@RalfJung
Browse files Browse the repository at this point in the history
Clarify align_to's requirements and obligations

Based on discussions with @RalfJung around my misunderstandings when using this.

r? @RalfJung
  • Loading branch information
Centril authored Aug 6, 2019
2 parents a13ff3d + 571e22d commit c668bb7
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/libcore/slice/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2308,9 +2308,10 @@ impl<T> [T] {
/// maintained.
///
/// This method splits the slice into three distinct slices: prefix, correctly aligned middle
/// slice of a new type, and the suffix slice. The method does a best effort to make the
/// middle slice the greatest length possible for a given type and input slice, but only
/// your algorithm's performance should depend on that, not its correctness.
/// slice of a new type, and the suffix slice. The method may make the middle slice the greatest
/// length possible for a given type and input slice, but only your algorithm's performance
/// should depend on that, not its correctness. It is permissible for all of the input data to
/// be returned as the prefix or suffix slice.
///
/// This method has no purpose when either input element `T` or output element `U` are
/// zero-sized and will return the original slice without splitting anything.
Expand Down Expand Up @@ -2361,9 +2362,10 @@ impl<T> [T] {
/// maintained.
///
/// This method splits the slice into three distinct slices: prefix, correctly aligned middle
/// slice of a new type, and the suffix slice. The method does a best effort to make the
/// middle slice the greatest length possible for a given type and input slice, but only
/// your algorithm's performance should depend on that, not its correctness.
/// slice of a new type, and the suffix slice. The method may make the middle slice the greatest
/// length possible for a given type and input slice, but only your algorithm's performance
/// should depend on that, not its correctness. It is permissible for all of the input data to
/// be returned as the prefix or suffix slice.
///
/// This method has no purpose when either input element `T` or output element `U` are
/// zero-sized and will return the original slice without splitting anything.
Expand Down

0 comments on commit c668bb7

Please sign in to comment.