about summary refs log tree commit diff
path: root/src/test/ui/allocator
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-08-05 03:04:21 +0000
committerbors <bors@rust-lang.org>2020-08-05 03:04:21 +0000
commit119d2a1a98fe87d4ae6cabf12134a0ef2fb95851 (patch)
treea7f10583f99e51db9b6beb3bb2d4e3a91c43ed0a /src/test/ui/allocator
parent32d14eba47ee8bb0b5edb04bcf652517f81c4cf5 (diff)
parent324faf1aacddb9197ea9c1e2296c7102a069513c (diff)
downloadrust-119d2a1a98fe87d4ae6cabf12134a0ef2fb95851.tar.gz
rust-119d2a1a98fe87d4ae6cabf12134a0ef2fb95851.zip
Auto merge of #75174 - JohnTitor:rollup-z9djftk, r=JohnTitor
Rollup of 5 pull requests

Successful merges:

 - #75139 (Remove log alias from librustdoc)
 - #75140 (Clean up E0745)
 - #75149 (Correct a typo in interpret/memory.rs)
 - #75152 (Replace `Memoryblock` with `NonNull<[u8]>`)
 - #75168 (Update books)

Failed merges:

r? @ghost
Diffstat (limited to 'src/test/ui/allocator')
-rw-r--r--src/test/ui/allocator/custom.rs9
-rw-r--r--src/test/ui/allocator/xcrate-use.rs9
2 files changed, 10 insertions, 8 deletions
diff --git a/src/test/ui/allocator/custom.rs b/src/test/ui/allocator/custom.rs
index f10d29f33fc..a6c2317c736 100644
--- a/src/test/ui/allocator/custom.rs
+++ b/src/test/ui/allocator/custom.rs
@@ -4,6 +4,7 @@
 // no-prefer-dynamic
 
 #![feature(allocator_api)]
+#![feature(slice_ptr_get)]
 
 extern crate helper;
 
@@ -38,9 +39,9 @@ fn main() {
         let layout = Layout::from_size_align(4, 2).unwrap();
 
         let memory = Global.alloc(layout.clone()).unwrap();
-        helper::work_with(&memory.ptr);
+        helper::work_with(&memory);
         assert_eq!(HITS.load(Ordering::SeqCst), n + 1);
-        Global.dealloc(memory.ptr, layout);
+        Global.dealloc(memory.as_non_null_ptr(), layout);
         assert_eq!(HITS.load(Ordering::SeqCst), n + 2);
 
         let s = String::with_capacity(10);
@@ -51,8 +52,8 @@ fn main() {
 
         let memory = System.alloc(layout.clone()).unwrap();
         assert_eq!(HITS.load(Ordering::SeqCst), n + 4);
-        helper::work_with(&memory.ptr);
-        System.dealloc(memory.ptr, layout);
+        helper::work_with(&memory);
+        System.dealloc(memory.as_non_null_ptr(), layout);
         assert_eq!(HITS.load(Ordering::SeqCst), n + 4);
     }
 }
diff --git a/src/test/ui/allocator/xcrate-use.rs b/src/test/ui/allocator/xcrate-use.rs
index c7d31f71074..a1446b3664d 100644
--- a/src/test/ui/allocator/xcrate-use.rs
+++ b/src/test/ui/allocator/xcrate-use.rs
@@ -5,6 +5,7 @@
 // no-prefer-dynamic
 
 #![feature(allocator_api)]
+#![feature(slice_ptr_get)]
 
 extern crate custom;
 extern crate helper;
@@ -21,15 +22,15 @@ fn main() {
         let layout = Layout::from_size_align(4, 2).unwrap();
 
         let memory = Global.alloc(layout.clone()).unwrap();
-        helper::work_with(&memory.ptr);
+        helper::work_with(&memory);
         assert_eq!(GLOBAL.0.load(Ordering::SeqCst), n + 1);
-        Global.dealloc(memory.ptr, layout);
+        Global.dealloc(memory.as_non_null_ptr(), layout);
         assert_eq!(GLOBAL.0.load(Ordering::SeqCst), n + 2);
 
         let memory = System.alloc(layout.clone()).unwrap();
         assert_eq!(GLOBAL.0.load(Ordering::SeqCst), n + 2);
-        helper::work_with(&memory.ptr);
-        System.dealloc(memory.ptr, layout);
+        helper::work_with(&memory);
+        System.dealloc(memory.as_non_null_ptr(), layout);
         assert_eq!(GLOBAL.0.load(Ordering::SeqCst), n + 2);
     }
 }