about summary refs log tree commit diff
path: root/src/test/ui/allocator
diff options
context:
space:
mode:
authorTim Diekmann <tim.diekmann@3dvision.de>2020-03-24 11:45:38 +0100
committerTim Diekmann <tim.diekmann@3dvision.de>2020-03-26 17:10:54 +0100
commit56cbf2f22aeb6448acd7eb49e9b2554c80bdbf79 (patch)
treeaf24a0972cda1bd07560e36c5edd5aa14b53fc7d /src/test/ui/allocator
parent2fbb07525e2f07a815e780a4268b11916248b5a9 (diff)
downloadrust-56cbf2f22aeb6448acd7eb49e9b2554c80bdbf79.tar.gz
rust-56cbf2f22aeb6448acd7eb49e9b2554c80bdbf79.zip
Overhaul of the `AllocRef` trait to match allocator-wg's latest consens
Diffstat (limited to 'src/test/ui/allocator')
-rw-r--r--src/test/ui/allocator/custom.rs6
-rw-r--r--src/test/ui/allocator/xcrate-use.rs8
2 files changed, 7 insertions, 7 deletions
diff --git a/src/test/ui/allocator/custom.rs b/src/test/ui/allocator/custom.rs
index c275db14b42..a6a03a39b96 100644
--- a/src/test/ui/allocator/custom.rs
+++ b/src/test/ui/allocator/custom.rs
@@ -7,7 +7,7 @@
 
 extern crate helper;
 
-use std::alloc::{self, Global, AllocRef, System, Layout};
+use std::alloc::{self, AllocInit, AllocRef, Global, Layout, System};
 use std::sync::atomic::{AtomicUsize, Ordering};
 
 static HITS: AtomicUsize = AtomicUsize::new(0);
@@ -37,7 +37,7 @@ fn main() {
     unsafe {
         let layout = Layout::from_size_align(4, 2).unwrap();
 
-        let (ptr, _) = Global.alloc(layout.clone()).unwrap();
+        let (ptr, _) = Global.alloc(layout.clone(), AllocInit::Uninitialized).unwrap();
         helper::work_with(&ptr);
         assert_eq!(HITS.load(Ordering::SeqCst), n + 1);
         Global.dealloc(ptr, layout.clone());
@@ -49,7 +49,7 @@ fn main() {
         drop(s);
         assert_eq!(HITS.load(Ordering::SeqCst), n + 4);
 
-        let (ptr, _) = System.alloc(layout.clone()).unwrap();
+        let (ptr, _) = System.alloc(layout.clone(), AllocInit::Uninitialized).unwrap();
         assert_eq!(HITS.load(Ordering::SeqCst), n + 4);
         helper::work_with(&ptr);
         System.dealloc(ptr, layout);
diff --git a/src/test/ui/allocator/xcrate-use.rs b/src/test/ui/allocator/xcrate-use.rs
index e4746d1a7ec..de47486cc3b 100644
--- a/src/test/ui/allocator/xcrate-use.rs
+++ b/src/test/ui/allocator/xcrate-use.rs
@@ -9,8 +9,8 @@
 extern crate custom;
 extern crate helper;
 
-use std::alloc::{Global, AllocRef, System, Layout};
-use std::sync::atomic::{Ordering, AtomicUsize};
+use std::alloc::{AllocInit, AllocRef, Global, Layout, System};
+use std::sync::atomic::{AtomicUsize, Ordering};
 
 #[global_allocator]
 static GLOBAL: custom::A = custom::A(AtomicUsize::new(0));
@@ -20,13 +20,13 @@ fn main() {
         let n = GLOBAL.0.load(Ordering::SeqCst);
         let layout = Layout::from_size_align(4, 2).unwrap();
 
-        let (ptr, _) = Global.alloc(layout.clone()).unwrap();
+        let (ptr, _) = Global.alloc(layout.clone(), AllocInit::Uninitialized).unwrap();
         helper::work_with(&ptr);
         assert_eq!(GLOBAL.0.load(Ordering::SeqCst), n + 1);
         Global.dealloc(ptr, layout.clone());
         assert_eq!(GLOBAL.0.load(Ordering::SeqCst), n + 2);
 
-        let (ptr, _) = System.alloc(layout.clone()).unwrap();
+        let (ptr, _) = System.alloc(layout.clone(), AllocInit::Uninitialized).unwrap();
         assert_eq!(GLOBAL.0.load(Ordering::SeqCst), n + 2);
         helper::work_with(&ptr);
         System.dealloc(ptr, layout);