expadn abi check + condese & fix tests

This commit is contained in:
DrMeepster 2022-02-27 20:25:16 -08:00
parent bfa7d44823
commit d316aba04c
3 changed files with 3 additions and 8 deletions

View File

@ -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);

View File

@ -1,6 +0,0 @@
// check-pass
#![feature(allocator_api)]
fn main() {
Box::new_in((), &std::alloc::Global);
}

View File

@ -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]));
}