]> git.lizzy.rs Git - rust.git/commitdiff
Rename `Alloc` to `AllocRef`
authorTim Diekmann <tim.diekmann@3dvision.de>
Sun, 26 Jan 2020 18:50:26 +0000 (19:50 +0100)
committerTim Diekmann <tim.diekmann@3dvision.de>
Wed, 29 Jan 2020 03:10:33 +0000 (04:10 +0100)
Required to land https://github.com/rust-lang/rust/pull/68529. Please see that PR for details. The CI is expected to fail until the PR is landed.

tests/compile-fail/deallocate-bad-alignment.rs
tests/compile-fail/deallocate-bad-size.rs
tests/compile-fail/deallocate-twice.rs
tests/compile-fail/reallocate-bad-size.rs
tests/compile-fail/reallocate-change-alloc.rs
tests/compile-fail/reallocate-dangling.rs
tests/run-pass/heap_allocator.rs

index d124136a965372acf99fab9e061e250eacbcadb0..2ac35a450cf196f07cd7fb29c32e667798fcdf65 100644 (file)
@@ -3,7 +3,7 @@
 extern crate alloc;
 
 use alloc::alloc::Global;
-use std::alloc::*;
+use std::alloc::{AllocRef, Layout};
 
 // error-pattern: incorrect alloc info: expected size 1 and align 2, got size 1 and align 1
 
index 7a95b0ac7e90a620815f637f93282bbda9eed413..c5b48f5ddf59005748010daa12a7573a2bde3878 100644 (file)
@@ -3,7 +3,7 @@
 extern crate alloc;
 
 use alloc::alloc::Global;
-use std::alloc::*;
+use std::alloc::{AllocRef, Layout};
 
 // error-pattern: incorrect alloc info: expected size 2 and align 1, got size 1 and align 1
 
index 03fab76d601b57cba3399e66f9aa3770ffc5d8cd..02c442f0ab85f068769e3081e98bbb5302ff7dd9 100644 (file)
@@ -3,7 +3,7 @@
 extern crate alloc;
 
 use alloc::alloc::Global;
-use std::alloc::*;
+use std::alloc::{AllocRef, Layout};
 
 // error-pattern: tried to deallocate dangling pointer
 
index 24d913205447d7f95791c03f7a1854a7e1681af1..905e8e061721274758c5e2077905c05366a00eab 100644 (file)
@@ -3,7 +3,7 @@
 extern crate alloc;
 
 use alloc::alloc::Global;
-use std::alloc::*;
+use std::alloc::{AllocRef, Layout};
 
 // error-pattern: incorrect alloc info: expected size 2 and align 1, got size 1 and align 1
 
index 312edfd52b27755c913693d519d1a4e9ced6bfa8..21468739b31c0b364d8e781601a26f1ba75260c1 100644 (file)
@@ -3,7 +3,7 @@
 extern crate alloc;
 
 use alloc::alloc::Global;
-use std::alloc::*;
+use std::alloc::{AllocRef, Layout};
 
 fn main() {
     unsafe {
index 450f63cc40d3570b29438df92242ff0f67eb2138..ee73cfce8634be4dc68d5a728f42b254a3b66ba8 100644 (file)
@@ -3,7 +3,7 @@
 extern crate alloc;
 
 use alloc::alloc::Global;
-use std::alloc::*;
+use std::alloc::{AllocRef, Layout};
 
 // error-pattern: dangling pointer was dereferenced
 
index 7bcb08058c36aa31aad50465429d9b695e8b6970..907fbf962df02ebdf687586edb966d8a71b8abd6 100644 (file)
@@ -1,10 +1,10 @@
 #![feature(allocator_api)]
 
 use std::ptr::NonNull;
-use std::alloc::{Global, Alloc, Layout, System};
+use std::alloc::{Global, AllocRef, Layout, System};
 use std::slice;
 
-fn check_alloc<T: Alloc>(mut allocator: T) { unsafe {
+fn check_alloc<T: AllocRef>(mut allocator: T) { unsafe {
     for &align in &[4, 8, 16, 32] {
         let layout = Layout::from_size_align(20, align).unwrap();
 
@@ -40,7 +40,7 @@ fn check_alloc<T: Alloc>(mut allocator: T) { unsafe {
     }
 } }
 
-fn check_align_requests<T: Alloc>(mut allocator: T) {
+fn check_align_requests<T: AllocRef>(mut allocator: T) {
     for &size in &[2, 8, 64] { // size less than and bigger than alignment
         for &align in &[4, 8, 16, 32] { // Be sure to cover less than and bigger than `MIN_ALIGN` for all architectures
             let iterations = 32;