@@ -1606,10 +1606,12 @@ impl<T: ?Sized> *const T {
1606
1606
/// `align`.
1607
1607
///
1608
1608
/// If it is not possible to align the pointer, the implementation returns
1609
- /// `usize::max_value()`.
1609
+ /// `usize::max_value()`. It is permissible for the implementation to *always*
1610
+ /// return `usize::max_value()`. Only your algorithm's performance can depend
1611
+ /// on getting a usable offset here, not its correctness.
1610
1612
///
1611
1613
/// The offset is expressed in number of `T` elements, and not bytes. The value returned can be
1612
- /// used with the `add ` method.
1614
+ /// used with the `wrapping_add ` method.
1613
1615
///
1614
1616
/// There are no guarantees whatsoever that offsetting the pointer will not overflow or go
1615
1617
/// beyond the allocation that the pointer points into. It is up to the caller to ensure that
@@ -2407,10 +2409,12 @@ impl<T: ?Sized> *mut T {
2407
2409
/// `align`.
2408
2410
///
2409
2411
/// If it is not possible to align the pointer, the implementation returns
2410
- /// `usize::max_value()`.
2412
+ /// `usize::max_value()`. It is permissible for the implementation to *always*
2413
+ /// return `usize::max_value()`. Only your algorithm's performance can depend
2414
+ /// on getting a usable offset here, not its correctness.
2411
2415
///
2412
2416
/// The offset is expressed in number of `T` elements, and not bytes. The value returned can be
2413
- /// used with the `add ` method.
2417
+ /// used with the `wrapping_add ` method.
2414
2418
///
2415
2419
/// There are no guarantees whatsoever that offsetting the pointer will not overflow or go
2416
2420
/// beyond the allocation that the pointer points into. It is up to the caller to ensure that
0 commit comments