Skip to content

Commit f6bbbe1

Browse files
committed
trans: Remove dropflag-unaware type_is_newtype_immediate shortcut.
1 parent cf0ea78 commit f6bbbe1

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

src/librustc_trans/trans/common.rs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -75,26 +75,13 @@ pub fn type_is_fat_ptr<'tcx>(cx: &TyCtxt<'tcx>, ty: Ty<'tcx>) -> bool {
7575
}
7676
}
7777

78-
fn type_is_newtype_immediate<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, ty: Ty<'tcx>) -> bool {
79-
match ty.sty {
80-
ty::TyStruct(def, substs) => {
81-
let fields = &def.struct_variant().fields;
82-
fields.len() == 1 && {
83-
type_is_immediate(ccx, monomorphize::field_ty(ccx.tcx(), substs, &fields[0]))
84-
}
85-
}
86-
_ => false
87-
}
88-
}
89-
9078
pub fn type_is_immediate<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, ty: Ty<'tcx>) -> bool {
9179
use trans::machine::llsize_of_alloc;
9280
use trans::type_of::sizing_type_of;
9381

9482
let tcx = ccx.tcx();
9583
let simple = ty.is_scalar() ||
9684
ty.is_unique() || ty.is_region_ptr() ||
97-
type_is_newtype_immediate(ccx, ty) ||
9885
ty.is_simd();
9986
if simple && !type_is_fat_ptr(tcx, ty) {
10087
return true;

0 commit comments

Comments
 (0)