Skip to content

Commit c668bb7

Browse files
authored
Rollup merge of rust-lang#63293 - shepmaster:align-to-doc, r=@RalfJung
Clarify align_to's requirements and obligations Based on discussions with @RalfJung around my misunderstandings when using this. r? @RalfJung
2 parents a13ff3d + 571e22d commit c668bb7

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/libcore/slice/mod.rs

+8-6
Original file line numberDiff line numberDiff line change
@@ -2308,9 +2308,10 @@ impl<T> [T] {
23082308
/// maintained.
23092309
///
23102310
/// This method splits the slice into three distinct slices: prefix, correctly aligned middle
2311-
/// slice of a new type, and the suffix slice. The method does a best effort to make the
2312-
/// middle slice the greatest length possible for a given type and input slice, but only
2313-
/// your algorithm's performance should depend on that, not its correctness.
2311+
/// slice of a new type, and the suffix slice. The method may make the middle slice the greatest
2312+
/// length possible for a given type and input slice, but only your algorithm's performance
2313+
/// should depend on that, not its correctness. It is permissible for all of the input data to
2314+
/// be returned as the prefix or suffix slice.
23142315
///
23152316
/// This method has no purpose when either input element `T` or output element `U` are
23162317
/// zero-sized and will return the original slice without splitting anything.
@@ -2361,9 +2362,10 @@ impl<T> [T] {
23612362
/// maintained.
23622363
///
23632364
/// This method splits the slice into three distinct slices: prefix, correctly aligned middle
2364-
/// slice of a new type, and the suffix slice. The method does a best effort to make the
2365-
/// middle slice the greatest length possible for a given type and input slice, but only
2366-
/// your algorithm's performance should depend on that, not its correctness.
2365+
/// slice of a new type, and the suffix slice. The method may make the middle slice the greatest
2366+
/// length possible for a given type and input slice, but only your algorithm's performance
2367+
/// should depend on that, not its correctness. It is permissible for all of the input data to
2368+
/// be returned as the prefix or suffix slice.
23672369
///
23682370
/// This method has no purpose when either input element `T` or output element `U` are
23692371
/// zero-sized and will return the original slice without splitting anything.

0 commit comments

Comments
 (0)