Skip to content

Commit a51b7dd

Browse files
authored
Rollup merge of #124624 - WaffleLapkin:old_unit, r=fmease
Use `tcx.types.unit` instead of `Ty::new_unit(tcx)` I don't think there is any need for the function, given that we can just access the `.types`, similarly to all other primitives?
2 parents aa74d35 + 579d616 commit a51b7dd

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
@@ -380,7 +380,7 @@ impl<'mir, 'tcx: 'mir> PrimitiveLayouts<'tcx> {
380380
let mut_raw_ptr = Ty::new_mut_ptr(tcx, tcx.types.unit);
381381
let const_raw_ptr = Ty::new_imm_ptr(tcx, tcx.types.unit);
382382
Ok(Self {
383-
unit: layout_cx.layout_of(Ty::new_unit(tcx))?,
383+
unit: layout_cx.layout_of(tcx.types.unit)?,
384384
i8: layout_cx.layout_of(tcx.types.i8)?,
385385
i16: layout_cx.layout_of(tcx.types.i16)?,
386386
i32: layout_cx.layout_of(tcx.types.i32)?,

0 commit comments

Comments
 (0)