Skip to content

Commit

Permalink
Rollup merge of rust-lang#134179 - zachs18:align_offset_mut_ptr_doc, …
Browse files Browse the repository at this point in the history
…r=workingjubilee

Remove outdated consteval note from `<*mut T>::align_offset` docs.
  • Loading branch information
GuillaumeGomez authored Dec 11, 2024
2 parents 01a01f1 + 6a8bc4b commit 7a4becc
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions library/core/src/ptr/mut_ptr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1587,15 +1587,6 @@ impl<T: ?Sized> *mut T {
/// beyond the allocation that the pointer points into. It is up to the caller to ensure that
/// the returned offset is correct in all terms other than alignment.
///
/// When this is called during compile-time evaluation (which is unstable), the implementation
/// may return `usize::MAX` in cases where that can never happen at runtime. This is because the
/// actual alignment of pointers is not known yet during compile-time, so an offset with
/// guaranteed alignment can sometimes not be computed. For example, a buffer declared as `[u8;
/// N]` might be allocated at an odd or an even address, but at compile-time this is not yet
/// known, so the execution has to be correct for either choice. It is therefore impossible to
/// find an offset that is guaranteed to be 2-aligned. (This behavior is subject to change, as usual
/// for unstable APIs.)
///
/// # Panics
///
/// The function panics if `align` is not a power-of-two.
Expand Down

0 comments on commit 7a4becc

Please sign in to comment.