diff options
| author | bjorn3 <bjorn3@users.noreply.github.com> | 2020-03-12 21:04:00 +0100 |
|---|---|---|
| committer | bjorn3 <bjorn3@users.noreply.github.com> | 2020-03-12 21:04:00 +0100 |
| commit | 1c02e6c368337bea10a57eb345bd36edbff75f87 (patch) | |
| tree | a5ba8e68aca3d36012c2d9bc1095f821c0407f6d /build_sysroot | |
| parent | b469bf3b08a1c7def04ed256342a68739d8dd6a7 (diff) | |
| download | rust-1c02e6c368337bea10a57eb345bd36edbff75f87.tar.gz rust-1c02e6c368337bea10a57eb345bd36edbff75f87.zip | |
Rustup to rustc 1.43.0-nightly (c20d7eecb 2020-03-11)
Diffstat (limited to 'build_sysroot')
| -rw-r--r-- | build_sysroot/alloc_system/lib.rs | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/build_sysroot/alloc_system/lib.rs b/build_sysroot/alloc_system/lib.rs index abfcf301a53..8ad0a076d3d 100644 --- a/build_sysroot/alloc_system/lib.rs +++ b/build_sysroot/alloc_system/lib.rs @@ -72,14 +72,16 @@ pub struct System; #[unstable(feature = "allocator_api", issue = "32838")] unsafe impl AllocRef for System { #[inline] - unsafe fn alloc(&mut self, layout: Layout) -> Result<(NonNull<u8>, usize), AllocErr> { - NonNull::new(GlobalAlloc::alloc(self, layout)).ok_or(AllocErr).map(|p| (p, layout.size())) + fn alloc(&mut self, layout: Layout) -> Result<(NonNull<u8>, usize), AllocErr> { + NonNull::new(unsafe { GlobalAlloc::alloc(self, layout) }) + .ok_or(AllocErr) + .map(|p| (p, layout.size())) } #[inline] - unsafe fn alloc_zeroed(&mut self, layout: Layout) -> Result<(NonNull<u8>, usize), AllocErr> { - NonNull::new(GlobalAlloc::alloc_zeroed(self, layout)) - .ok_or(AllocErr) - .map(|p| (p, layout.size())) + fn alloc_zeroed(&mut self, layout: Layout) -> Result<(NonNull<u8>, usize), AllocErr> { + NonNull::new(unsafe { GlobalAlloc::alloc_zeroed(self, layout) }) + .ok_or(AllocErr) + .map(|p| (p, layout.size())) } #[inline] unsafe fn dealloc(&mut self, ptr: NonNull<u8>, layout: Layout) { |
