]> git.proxmox.com Git - rustc.git/blobdiff - src/liballoc/tests/heap.rs
New upstream version 1.43.0+dfsg1
[rustc.git] / src / liballoc / tests / heap.rs
index 43cd7187823f0ad0b395dde8b5ce8b7704217cc4..d159126f426c52070b7290f0025dfe191d093c75 100644 (file)
@@ -1,4 +1,4 @@
-use std::alloc::{Alloc, Global, Layout, System};
+use std::alloc::{AllocRef, Global, Layout, System};
 
 /// Issue #45955 and #62251.
 #[test]
@@ -11,7 +11,7 @@ fn std_heap_overaligned_request() {
     check_overalign_requests(Global)
 }
 
-fn check_overalign_requests<T: Alloc>(mut allocator: T) {
+fn check_overalign_requests<T: AllocRef>(mut allocator: T) {
     for &align in &[4, 8, 16, 32] {
         // less than and bigger than `MIN_ALIGN`
         for &size in &[align / 2, align - 1] {
@@ -20,7 +20,7 @@ fn check_overalign_requests<T: Alloc>(mut allocator: T) {
             unsafe {
                 let pointers: Vec<_> = (0..iterations)
                     .map(|_| {
-                        allocator.alloc(Layout::from_size_align(size, align).unwrap()).unwrap()
+                        allocator.alloc(Layout::from_size_align(size, align).unwrap()).unwrap().0
                     })
                     .collect();
                 for &ptr in &pointers {