Skip to content

Commit 3d8bf92

Browse files
committed
Rename Alloc to AllocRef
Required to land rust-lang/rust#68529. Please see that PR for details. The CI is expected to fail until the PR is landed.
1 parent 8340358 commit 3d8bf92

7 files changed

+9
-9
lines changed

tests/compile-fail/deallocate-bad-alignment.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
extern crate alloc;
44

55
use alloc::alloc::Global;
6-
use std::alloc::*;
6+
use std::alloc::{AllocRef, Layout};
77

88
// error-pattern: incorrect alloc info: expected size 1 and align 2, got size 1 and align 1
99

tests/compile-fail/deallocate-bad-size.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
extern crate alloc;
44

55
use alloc::alloc::Global;
6-
use std::alloc::*;
6+
use std::alloc::{AllocRef, Layout};
77

88
// error-pattern: incorrect alloc info: expected size 2 and align 1, got size 1 and align 1
99

tests/compile-fail/deallocate-twice.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
extern crate alloc;
44

55
use alloc::alloc::Global;
6-
use std::alloc::*;
6+
use std::alloc::{AllocRef, Layout};
77

88
// error-pattern: tried to deallocate dangling pointer
99

tests/compile-fail/reallocate-bad-size.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
extern crate alloc;
44

55
use alloc::alloc::Global;
6-
use std::alloc::*;
6+
use std::alloc::{AllocRef, Layout};
77

88
// error-pattern: incorrect alloc info: expected size 2 and align 1, got size 1 and align 1
99

tests/compile-fail/reallocate-change-alloc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
extern crate alloc;
44

55
use alloc::alloc::Global;
6-
use std::alloc::*;
6+
use std::alloc::{AllocRef, Layout};
77

88
fn main() {
99
unsafe {

tests/compile-fail/reallocate-dangling.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
extern crate alloc;
44

55
use alloc::alloc::Global;
6-
use std::alloc::*;
6+
use std::alloc::{AllocRef, Layout};
77

88
// error-pattern: dangling pointer was dereferenced
99

tests/run-pass/heap_allocator.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#![feature(allocator_api)]
22

33
use std::ptr::NonNull;
4-
use std::alloc::{Global, Alloc, Layout, System};
4+
use std::alloc::{Global, AllocRef, Layout, System};
55
use std::slice;
66

7-
fn check_alloc<T: Alloc>(mut allocator: T) { unsafe {
7+
fn check_alloc<T: AllocRef>(mut allocator: T) { unsafe {
88
for &align in &[4, 8, 16, 32] {
99
let layout = Layout::from_size_align(20, align).unwrap();
1010

@@ -40,7 +40,7 @@ fn check_alloc<T: Alloc>(mut allocator: T) { unsafe {
4040
}
4141
} }
4242

43-
fn check_align_requests<T: Alloc>(mut allocator: T) {
43+
fn check_align_requests<T: AllocRef>(mut allocator: T) {
4444
for &size in &[2, 8, 64] { // size less than and bigger than alignment
4545
for &align in &[4, 8, 16, 32] { // Be sure to cover less than and bigger than `MIN_ALIGN` for all architectures
4646
let iterations = 32;

0 commit comments

Comments
 (0)