diff options
| author | Joshua Liebow-Feeser <joshlf@users.noreply.github.com> | 2023-09-07 12:54:34 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-09-07 12:54:34 -0700 |
| commit | 25b81024a50647cc364cc1a7ab6aa000fef4b915 (patch) | |
| tree | 112bb019dc6f0238127ebf1f0451409899f41a22 /library/core/src/alloc | |
| parent | 70c7e4d21c7249af4222a10d09dc03286aa1e787 (diff) | |
| download | rust-25b81024a50647cc364cc1a7ab6aa000fef4b915.tar.gz rust-25b81024a50647cc364cc1a7ab6aa000fef4b915.zip | |
Guarantee that Layout::align returns a non-zero power of two
Diffstat (limited to 'library/core/src/alloc')
| -rw-r--r-- | library/core/src/alloc/layout.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/library/core/src/alloc/layout.rs b/library/core/src/alloc/layout.rs index 59730303734..dcfb42759f3 100644 --- a/library/core/src/alloc/layout.rs +++ b/library/core/src/alloc/layout.rs @@ -130,6 +130,8 @@ impl Layout { } /// The minimum byte alignment for a memory block of this layout. + /// + /// The returned alignment is guaranteed to be a non-zero power of two. #[stable(feature = "alloc_layout", since = "1.28.0")] #[rustc_const_stable(feature = "const_alloc_layout_size_align", since = "1.50.0")] #[must_use = "this returns the minimum alignment, \ |
