Skip to content

Commit

Permalink
expadn abi check + condese & fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
beepster4096 committed Feb 28, 2022
1 parent bfa7d44 commit d316aba
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_ssa/src/mir/place.rs
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
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);

Expand Down
6 changes: 0 additions & 6 deletions src/test/ui/box/issue-78459-ice.rs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// check-pass
// build-pass
#![feature(allocator_api)]

use std::alloc::Allocator;
Expand All @@ -18,5 +18,6 @@ unsafe impl Allocator for BigAllocator {
}

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

0 comments on commit d316aba

Please sign in to comment.