diff options
| author | Tim Diekmann <tim.diekmann@3dvision.de> | 2020-03-26 17:11:47 +0100 |
|---|---|---|
| committer | Tim Diekmann <tim.diekmann@3dvision.de> | 2020-03-26 17:11:47 +0100 |
| commit | 2526accdd35c564eee80b6453a0b4965e6a76afd (patch) | |
| tree | 76705d1a424dc9682b2e1c2599db6a0985d25335 /src/liballoc/tests | |
| parent | 56cbf2f22aeb6448acd7eb49e9b2554c80bdbf79 (diff) | |
| download | rust-2526accdd35c564eee80b6453a0b4965e6a76afd.tar.gz rust-2526accdd35c564eee80b6453a0b4965e6a76afd.zip | |
Fix issues from review and unsoundness of `RawVec::into_box`
Diffstat (limited to 'src/liballoc/tests')
| -rw-r--r-- | src/liballoc/tests/heap.rs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/liballoc/tests/heap.rs b/src/liballoc/tests/heap.rs index 690ae84a5df..4b0d7bc1f44 100644 --- a/src/liballoc/tests/heap.rs +++ b/src/liballoc/tests/heap.rs @@ -1,4 +1,4 @@ -use std::alloc::{AllocInit, AllocRef, Global, Layout, System}; +use std::alloc::{AllocInit, AllocRef, Global, Layout, MemoryBlock, System}; /// Issue #45955 and #62251. #[test] @@ -26,7 +26,7 @@ fn check_overalign_requests<T: AllocRef>(mut allocator: T) { AllocInit::Uninitialized, ) .unwrap() - .0 + .ptr() }) .collect(); for &ptr in &pointers { @@ -39,7 +39,10 @@ fn check_overalign_requests<T: AllocRef>(mut allocator: T) { // Clean up for &ptr in &pointers { - allocator.dealloc(ptr, Layout::from_size_align(size, align).unwrap()) + allocator.dealloc(MemoryBlock::new( + ptr, + Layout::from_size_align(size, align).unwrap(), + )) } } } |
