Rollup merge of #95618 - adamse:master, r=dtolnay

core: document that the align_of* functions return the alignment in bytes
This commit is contained in:
Dylan DPC 2022-04-03 23:21:45 +02:00 committed by GitHub
commit 1ea6e93610
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -383,7 +383,7 @@ pub const fn size_of_val<T: ?Sized>(val: &T) -> usize {
unsafe { intrinsics::size_of_val(val) }
}
/// Returns the [ABI]-required minimum alignment of a type.
/// Returns the [ABI]-required minimum alignment of a type in bytes.
///
/// Every reference to a value of the type `T` must be a multiple of this number.
///
@ -407,7 +407,8 @@ pub fn min_align_of<T>() -> usize {
intrinsics::min_align_of::<T>()
}
/// Returns the [ABI]-required minimum alignment of the type of the value that `val` points to.
/// Returns the [ABI]-required minimum alignment of the type of the value that `val` points to in
/// bytes.
///
/// Every reference to a value of the type `T` must be a multiple of this number.
///
@ -430,7 +431,7 @@ pub fn min_align_of_val<T: ?Sized>(val: &T) -> usize {
unsafe { intrinsics::min_align_of_val(val) }
}
/// Returns the [ABI]-required minimum alignment of a type.
/// Returns the [ABI]-required minimum alignment of a type in bytes.
///
/// Every reference to a value of the type `T` must be a multiple of this number.
///
@ -454,7 +455,8 @@ pub const fn align_of<T>() -> usize {
intrinsics::min_align_of::<T>()
}
/// Returns the [ABI]-required minimum alignment of the type of the value that `val` points to.
/// Returns the [ABI]-required minimum alignment of the type of the value that `val` points to in
/// bytes.
///
/// Every reference to a value of the type `T` must be a multiple of this number.
///
@ -477,7 +479,8 @@ pub const fn align_of_val<T: ?Sized>(val: &T) -> usize {
unsafe { intrinsics::min_align_of_val(val) }
}
/// Returns the [ABI]-required minimum alignment of the type of the value that `val` points to.
/// Returns the [ABI]-required minimum alignment of the type of the value that `val` points to in
/// bytes.
///
/// Every reference to a value of the type `T` must be a multiple of this number.
///