summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorTim Diekmann <tim.diekmann@3dvision.de>2020-03-28 20:21:26 +0100
committerTim Diekmann <tim.diekmann@3dvision.de>2020-03-28 20:22:07 +0100
commitbf6a46db3129b0bf31dc67f06af2e52ece52701a (patch)
tree202ce2e37985e512df1e0b005a79010aa0a66a58 /src/test
parentdb15fe6b383741ae1cc13cfb62fc1c18f8ff5241 (diff)
downloadrust-bf6a46db3129b0bf31dc67f06af2e52ece52701a.tar.gz
rust-bf6a46db3129b0bf31dc67f06af2e52ece52701a.zip
Make fields in `MemoryBlock` public
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ui/allocator/custom.rs8
-rw-r--r--src/test/ui/allocator/xcrate-use.rs8
-rw-r--r--src/test/ui/realloc-16687.rs8
-rw-r--r--src/test/ui/regions/regions-mock-codegen.rs2
4 files changed, 13 insertions, 13 deletions
diff --git a/src/test/ui/allocator/custom.rs b/src/test/ui/allocator/custom.rs
index 8f894c5db5d..184e4706a4c 100644
--- a/src/test/ui/allocator/custom.rs
+++ b/src/test/ui/allocator/custom.rs
@@ -38,9 +38,9 @@ fn main() {
         let layout = Layout::from_size_align(4, 2).unwrap();
 
         let memory = Global.alloc(layout.clone(), AllocInit::Uninitialized).unwrap();
-        helper::work_with(&memory.ptr());
+        helper::work_with(&memory.ptr);
         assert_eq!(HITS.load(Ordering::SeqCst), n + 1);
-        Global.dealloc(memory.ptr(), layout);
+        Global.dealloc(memory.ptr, layout);
         assert_eq!(HITS.load(Ordering::SeqCst), n + 2);
 
         let s = String::with_capacity(10);
@@ -51,8 +51,8 @@ fn main() {
 
         let memory = System.alloc(layout.clone(), AllocInit::Uninitialized).unwrap();
         assert_eq!(HITS.load(Ordering::SeqCst), n + 4);
-        helper::work_with(&memory.ptr());
-        System.dealloc(memory.ptr(), layout);
+        helper::work_with(&memory.ptr);
+        System.dealloc(memory.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 689804bde86..7de1ab7a553 100644
--- a/src/test/ui/allocator/xcrate-use.rs
+++ b/src/test/ui/allocator/xcrate-use.rs
@@ -21,15 +21,15 @@ fn main() {
         let layout = Layout::from_size_align(4, 2).unwrap();
 
         let memory = Global.alloc(layout.clone(), AllocInit::Uninitialized).unwrap();
-        helper::work_with(&memory.ptr());
+        helper::work_with(&memory.ptr);
         assert_eq!(GLOBAL.0.load(Ordering::SeqCst), n + 1);
-        Global.dealloc(memory.ptr(), layout);
+        Global.dealloc(memory.ptr, layout);
         assert_eq!(GLOBAL.0.load(Ordering::SeqCst), n + 2);
 
         let memory = System.alloc(layout.clone(), AllocInit::Uninitialized).unwrap();
         assert_eq!(GLOBAL.0.load(Ordering::SeqCst), n + 2);
-        helper::work_with(&memory.ptr());
-        System.dealloc(memory.ptr(), layout);
+        helper::work_with(&memory.ptr);
+        System.dealloc(memory.ptr, layout);
         assert_eq!(GLOBAL.0.load(Ordering::SeqCst), n + 2);
     }
 }
diff --git a/src/test/ui/realloc-16687.rs b/src/test/ui/realloc-16687.rs
index 8c419185f51..0687a9ce454 100644
--- a/src/test/ui/realloc-16687.rs
+++ b/src/test/ui/realloc-16687.rs
@@ -46,10 +46,10 @@ unsafe fn test_triangle() -> bool {
             .unwrap_or_else(|_| handle_alloc_error(layout));
 
         if PRINT {
-            println!("allocate({:?}) = {:?}", layout, memory.ptr());
+            println!("allocate({:?}) = {:?}", layout, memory.ptr);
         }
 
-        memory.ptr().cast().as_ptr()
+        memory.ptr.cast().as_ptr()
     }
 
     unsafe fn deallocate(ptr: *mut u8, layout: Layout) {
@@ -82,9 +82,9 @@ unsafe fn test_triangle() -> bool {
         });
 
         if PRINT {
-            println!("reallocate({:?}, old={:?}, new={:?}) = {:?}", ptr, old, new, memory.ptr());
+            println!("reallocate({:?}, old={:?}, new={:?}) = {:?}", ptr, old, new, memory.ptr);
         }
-        memory.ptr().cast().as_ptr()
+        memory.ptr.cast().as_ptr()
     }
 
     fn idx_to_size(i: usize) -> usize {
diff --git a/src/test/ui/regions/regions-mock-codegen.rs b/src/test/ui/regions/regions-mock-codegen.rs
index 148b0a86a05..380310190be 100644
--- a/src/test/ui/regions/regions-mock-codegen.rs
+++ b/src/test/ui/regions/regions-mock-codegen.rs
@@ -28,7 +28,7 @@ fn alloc(_bcx: &arena) -> &Bcx<'_> {
         let memory = Global
             .alloc(layout, AllocInit::Uninitialized)
             .unwrap_or_else(|_| handle_alloc_error(layout));
-        &*(memory.ptr().as_ptr() as *const _)
+        &*(memory.ptr.as_ptr() as *const _)
     }
 }