expadn abi check + condese & fix tests
This commit is contained in:
parent
bfa7d44823
commit
d316aba04c
3 changed files with 3 additions and 8 deletions
|
@ -456,7 +456,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
|
||||||
mir::ProjectionElem::Deref => {
|
mir::ProjectionElem::Deref => {
|
||||||
// custom allocators can change box's abi, making it unable to be derefed directly
|
// custom allocators can change box's abi, making it unable to be derefed directly
|
||||||
if cg_base.layout.ty.is_box()
|
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);
|
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)]
|
#![feature(allocator_api)]
|
||||||
|
|
||||||
use std::alloc::Allocator;
|
use std::alloc::Allocator;
|
||||||
|
@ -18,5 +18,6 @@ unsafe impl Allocator for BigAllocator {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
Box::new_in((), &std::alloc::Global);
|
||||||
Box::new_in((), BigAllocator([0; 2]));
|
Box::new_in((), BigAllocator([0; 2]));
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue