diff options
| author | Christopher Durham <cad97@cad97.com> | 2019-11-25 16:05:33 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-11-25 16:05:33 -0500 |
| commit | 6773064b0529c258c4f69bb7848371553447b088 (patch) | |
| tree | 8ef4006ba812d1a156be730350d2e2d016cc5113 /src/libcore | |
| parent | b9da350b09385dd969f5da3c3f9be0b356897099 (diff) | |
| download | rust-6773064b0529c258c4f69bb7848371553447b088.tar.gz rust-6773064b0529c258c4f69bb7848371553447b088.zip | |
Remove unsafe in Layout::pad_to_align
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/alloc.rs | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/libcore/alloc.rs b/src/libcore/alloc.rs index d08440192b0..68fa2b5c20d 100644 --- a/src/libcore/alloc.rs +++ b/src/libcore/alloc.rs @@ -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 |
