mirror of
https://github.com/rust-lang/rust.git
synced 2026-06-01 22:18:23 +03:00
Rename Alloc to AllocRef
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.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
extern crate alloc;
|
||||
|
||||
use alloc::alloc::Global;
|
||||
use std::alloc::*;
|
||||
use std::alloc::{AllocRef, Layout};
|
||||
|
||||
fn main() {
|
||||
unsafe {
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user