Skip to content

Commit 6773064

Browse files
authored
Remove unsafe in Layout::pad_to_align
1 parent b9da350 commit 6773064

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/libcore/alloc.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -225,9 +225,7 @@ impl Layout {
225225
// > `usize::MAX`)
226226
let new_size = self.size() + pad;
227227

228-
// SAFETY: This necessarily respects the from_size_align
229-
// prerequisites per the above.
230-
unsafe { Layout::from_size_align_unchecked(new_size, self.align()) }
228+
Layout::from_size_align(new_size, self.align()).unwrap()
231229
}
232230

233231
/// Creates a layout describing the record for `n` instances of

0 commit comments

Comments
 (0)