expadn abi check + condese & fix tests
This commit is contained in:
parent
bfa7d44823
commit
d316aba04c
@ -456,7 +456,7 @@ pub fn codegen_place(
|
||||
mir::ProjectionElem::Deref => {
|
||||
// custom allocators can change box's abi, making it unable to be derefed directly
|
||||
if cg_base.layout.ty.is_box()
|
||||
&& matches!(cg_base.layout.abi, Abi::Aggregate { .. })
|
||||
&& matches!(cg_base.layout.abi, Abi::Aggregate { .. } | Abi::Uninhabited)
|
||||
{
|
||||
let ptr = cg_base.project_field(bx, 0).project_field(bx, 0);
|
||||
|
||||
|
@ -1,6 +0,0 @@
|
||||
// check-pass
|
||||
#![feature(allocator_api)]
|
||||
|
||||
fn main() {
|
||||
Box::new_in((), &std::alloc::Global);
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
// check-pass
|
||||
// build-pass
|
||||
#![feature(allocator_api)]
|
||||
|
||||
use std::alloc::Allocator;
|
||||
@ -18,5 +18,6 @@ unsafe fn deallocate(&self, _: std::ptr::NonNull<u8>, _: std::alloc::Layout) {
|
||||
}
|
||||
|
||||
fn main() {
|
||||
Box::new_in((), &std::alloc::Global);
|
||||
Box::new_in((), BigAllocator([0; 2]));
|
||||
}
|
Loading…
Reference in New Issue
Block a user