// This one has to be a re-export (rather than wrapping the underlying intrinsic) so that we can do
/// While `mem::forget` can also be used to transfer *memory* ownership, doing so is error-prone.
/// This is the alignment used for struct fields. It may be smaller than the preferred alignment.
/// Returns the [ABI]-required minimum alignment of the type of the value that `val` points to in
#[deprecated(note = "use `align_of_val` instead", since = "1.2.0", suggestion = "align_of_val")]
/// This is the alignment used for struct fields. It may be smaller than the preferred alignment.
/// Returns the [ABI]-required minimum alignment of the type of the value that `val` points to in
/// Returns the [ABI]-required minimum alignment of the type of the value that `val` points to in
/// It also might be slower than using `MaybeUninit<T>` due to mitigations that were put in place to
/// Note that `T` does not necessarily implement [`Clone`], so we can't even clone `self.buf[i]` to
/// avoid the move. But `replace` can be used to disassociate the original value at that index from
/// It is useful when you want to pass a function pointer to a combinator, rather than defining a new closure.
/// This function will unsafely assume the pointer `src` is valid for [`size_of::<Dst>`][size_of]
/// bytes by transmuting `&Src` to `&Dst` and then reading the `&Dst` (except that this is done
/// in a way that is correct even when `&Dst` has stricter alignment requirements than `&Src`).
/// If `T` is not an enum, calling this function will not result in undefined behavior, but the
/// The discriminant of an enum variant may change if the enum definition changes. A discriminant
/// of some variant will not change between compilations with the same compiler. See the [Reference]
/// [Reference]: ../../reference/items/enumerations.html#custom-discriminant-values-for-fieldless-enumerations
/// [`transmute`] or otherwise) is always sound. Note that this is **not** true for other kinds
/// Note that it is *undefined behavior* to [`transmute`] from [`Discriminant`] to a primitive!
/// If an enum has only unit variants, then the numeric value of the discriminant can be accessed
/// // assert_eq!(0, unsafe { std::mem::transmute::<_, u8>(std::mem::discriminant(&unit_like)) });
/// If `T` is not an enum, calling this function will not result in undefined behavior, but the
/// return value is unspecified. Equally, if `T` is an enum with more variants than `usize::MAX`
/// The field’s type must be [`Sized`], but it may be located in a [dynamically sized] container.
/// If the field type is dynamically sized, then you cannot use `offset_of!` (since the field's
/// [explicit `repr` attribute]: https://doc.rust-lang.org/reference/type-layout.html#representations
/// [`offset_of_enum`]: https://doc.rust-lang.org/nightly/unstable-book/language-features/offset-of-enum.html
/// [`offset_of_slice`]: https://doc.rust-lang.org/nightly/unstable-book/language-features/offset-of-slice.html