Skip to content

Commit d316aba

Browse files
committed
expadn abi check + condese & fix tests
1 parent bfa7d44 commit d316aba

File tree

3 files changed

+3
-8
lines changed

3 files changed

+3
-8
lines changed

compiler/rustc_codegen_ssa/src/mir/place.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
456456
mir::ProjectionElem::Deref => {
457457
// custom allocators can change box's abi, making it unable to be derefed directly
458458
if cg_base.layout.ty.is_box()
459-
&& matches!(cg_base.layout.abi, Abi::Aggregate { .. })
459+
&& matches!(cg_base.layout.abi, Abi::Aggregate { .. } | Abi::Uninhabited)
460460
{
461461
let ptr = cg_base.project_field(bx, 0).project_field(bx, 0);
462462

src/test/ui/box/issue-78459-ice.rs

-6
This file was deleted.

src/test/ui/box/issue-81270-ice.rs src/test/ui/box/large-allocator-ice.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// check-pass
1+
// build-pass
22
#![feature(allocator_api)]
33

44
use std::alloc::Allocator;
@@ -18,5 +18,6 @@ unsafe impl Allocator for BigAllocator {
1818
}
1919

2020
fn main() {
21+
Box::new_in((), &std::alloc::Global);
2122
Box::new_in((), BigAllocator([0; 2]));
2223
}

0 commit comments

Comments
 (0)