Remove unsafe in Layout::pad_to_align
This commit is contained in:
parent
b9da350b09
commit
6773064b05
@ -225,9 +225,7 @@ impl Layout {
|
||||
// > `usize::MAX`)
|
||||
let new_size = self.size() + pad;
|
||||
|
||||
// SAFETY: This necessarily respects the from_size_align
|
||||
// prerequisites per the above.
|
||||
unsafe { Layout::from_size_align_unchecked(new_size, self.align()) }
|
||||
Layout::from_size_align(new_size, self.align()).unwrap()
|
||||
}
|
||||
|
||||
/// Creates a layout describing the record for `n` instances of
|
||||
|
Loading…
x
Reference in New Issue
Block a user