about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDylan DPC <99973273+Dylan-DPC@users.noreply.github.com>2022-04-03 23:21:45 +0200
committerGitHub <noreply@github.com>2022-04-03 23:21:45 +0200
commit1ea6e936106cbf93d8b32844f2d2598a599a89b4 (patch)
treeb0006d75855880faca5257f11ff60d90505b9e93
parentf7f2d83eda99c6020c825a048739b476b0214104 (diff)
parent9d4d5a4eeb7d01e34e18490baeae7a68642c316c (diff)
downloadrust-1ea6e936106cbf93d8b32844f2d2598a599a89b4.tar.gz
rust-1ea6e936106cbf93d8b32844f2d2598a599a89b4.zip
Rollup merge of #95618 - adamse:master, r=dtolnay
core: document that the align_of* functions return the alignment in bytes
-rw-r--r--library/core/src/mem/mod.rs13
1 files changed, 8 insertions, 5 deletions
diff --git a/library/core/src/mem/mod.rs b/library/core/src/mem/mod.rs
index 005f8749e01..0d33fea75f4 100644
--- a/library/core/src/mem/mod.rs
+++ b/library/core/src/mem/mod.rs
@@ -383,7 +383,7 @@ pub const unsafe fn size_of_val_raw<T: ?Sized>(val: *const 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.
 ///