Skip to content

Commit c3faa5e

Browse files
committed
Auto merge of #111035 - Nilstrieb:layout-err, r=wesleywiser
Shrink error variants for layout and fn_abi The errors are bigger than the result, so let's put them behind a reference. Since query results have to be `Copy`, we use a reference into the arena instead of a `Box<T>`.
2 parents f5abdca + f7d0bf4 commit c3faa5e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/machine.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ pub struct PrimitiveLayouts<'tcx> {
311311
}
312312

313313
impl<'mir, 'tcx: 'mir> PrimitiveLayouts<'tcx> {
314-
fn new(layout_cx: LayoutCx<'tcx, TyCtxt<'tcx>>) -> Result<Self, LayoutError<'tcx>> {
314+
fn new(layout_cx: LayoutCx<'tcx, TyCtxt<'tcx>>) -> Result<Self, &'tcx LayoutError<'tcx>> {
315315
let tcx = layout_cx.tcx;
316316
let mut_raw_ptr = tcx.mk_ptr(TypeAndMut { ty: tcx.types.unit, mutbl: Mutability::Mut });
317317
let const_raw_ptr = tcx.mk_ptr(TypeAndMut { ty: tcx.types.unit, mutbl: Mutability::Not });

0 commit comments

Comments
 (0)