Skip to content

Commit

Permalink
Clarify Layout::pad_to_align safety comment
Browse files Browse the repository at this point in the history
  • Loading branch information
CAD97 authored Nov 25, 2019
1 parent 6773064 commit d1e53da
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libcore/alloc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ impl Layout {
#[inline]
pub fn pad_to_align(&self) -> Layout {
let pad = self.padding_needed_for(self.align());
// This cannot overflow: it is an invariant of Layout that
// This cannot overflow. Quoting from the invariant of Layout:
// > `size`, when rounded up to the nearest multiple of `align`,
// > must not overflow (i.e., the rounded value must be less than
// > `usize::MAX`)
Expand Down

0 comments on commit d1e53da

Please sign in to comment.