From f6bbbe10707504065d80733a6bab81f1f4586df8 Mon Sep 17 00:00:00 2001 From: Eduard Burtescu Date: Wed, 24 Feb 2016 19:00:54 +0200 Subject: [PATCH] trans: Remove dropflag-unaware type_is_newtype_immediate shortcut. --- src/librustc_trans/trans/common.rs | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/librustc_trans/trans/common.rs b/src/librustc_trans/trans/common.rs index b9f9004d7ee..4d229541a83 100644 --- a/src/librustc_trans/trans/common.rs +++ b/src/librustc_trans/trans/common.rs @@ -75,18 +75,6 @@ pub fn type_is_fat_ptr<'tcx>(cx: &TyCtxt<'tcx>, ty: Ty<'tcx>) -> bool { } } -fn type_is_newtype_immediate<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, ty: Ty<'tcx>) -> bool { - match ty.sty { - ty::TyStruct(def, substs) => { - let fields = &def.struct_variant().fields; - fields.len() == 1 && { - type_is_immediate(ccx, monomorphize::field_ty(ccx.tcx(), substs, &fields[0])) - } - } - _ => false - } -} - pub fn type_is_immediate<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, ty: Ty<'tcx>) -> bool { use trans::machine::llsize_of_alloc; use trans::type_of::sizing_type_of; @@ -94,7 +82,6 @@ pub fn type_is_immediate<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, ty: Ty<'tcx>) - let tcx = ccx.tcx(); let simple = ty.is_scalar() || ty.is_unique() || ty.is_region_ptr() || - type_is_newtype_immediate(ccx, ty) || ty.is_simd(); if simple && !type_is_fat_ptr(tcx, ty) { return true; -- GitLab