We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b9da350 commit 6773064Copy full SHA for 6773064
src/libcore/alloc.rs
@@ -225,9 +225,7 @@ impl Layout {
225
// > `usize::MAX`)
226
let new_size = self.size() + pad;
227
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()) }
+ Layout::from_size_align(new_size, self.align()).unwrap()
231
}
232
233
/// Creates a layout describing the record for `n` instances of
0 commit comments