diff options
| author | blitzerr <rusty.blitzerr@gmail.com> | 2020-09-20 20:14:44 -0700 |
|---|---|---|
| committer | blitzerr <rusty.blitzerr@gmail.com> | 2020-09-21 16:43:36 -0700 |
| commit | d9d02fa168016b5b5b2033a2964a723f447f94b0 (patch) | |
| tree | e649c2f8137da4515a01a4e606d641f7765cd18f /src/test/ui/allocator/custom.rs | |
| parent | fb1dc34a831688f8eca89ea22ea2eb39e881d729 (diff) | |
| download | rust-d9d02fa168016b5b5b2033a2964a723f447f94b0.tar.gz rust-d9d02fa168016b5b5b2033a2964a723f447f94b0.zip | |
Changing the alloc() to accept &self instead of &mut self
Diffstat (limited to 'src/test/ui/allocator/custom.rs')
| -rw-r--r-- | src/test/ui/allocator/custom.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/test/ui/allocator/custom.rs b/src/test/ui/allocator/custom.rs index a6c2317c736..603f59ab069 100644 --- a/src/test/ui/allocator/custom.rs +++ b/src/test/ui/allocator/custom.rs @@ -18,7 +18,7 @@ struct A; unsafe impl alloc::GlobalAlloc for A { unsafe fn alloc(&self, layout: Layout) -> *mut u8 { HITS.fetch_add(1, Ordering::SeqCst); - System.alloc(layout) + AllocRef::alloc(&System, layout).unwrap().as_mut_ptr() } unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout) { |
