Skip to content

Commit d1e53da

Browse files
authored
Clarify Layout::pad_to_align safety comment
1 parent 6773064 commit d1e53da

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libcore/alloc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ impl Layout {
219219
#[inline]
220220
pub fn pad_to_align(&self) -> Layout {
221221
let pad = self.padding_needed_for(self.align());
222-
// This cannot overflow: it is an invariant of Layout that
222+
// This cannot overflow. Quoting from the invariant of Layout:
223223
// > `size`, when rounded up to the nearest multiple of `align`,
224224
// > must not overflow (i.e., the rounded value must be less than
225225
// > `usize::MAX`)

0 commit comments

Comments
 (0)