diff --git a/src/librustc/middle/trans/common.rs b/src/librustc/middle/trans/common.rs index bbed6324543..b1b7441f243 100644 --- a/src/librustc/middle/trans/common.rs +++ b/src/librustc/middle/trans/common.rs @@ -75,6 +75,9 @@ pub fn type_is_immediate(ccx: &mut CrateContext, ty: ty::t) -> bool { } match ty::get(ty).sty { // FIXME: #9651: small `ty_struct` should also be immediate + ty::ty_struct(def_id, ref substs) => { + ty::struct_fields(tcx, def_id, substs).is_empty() + } ty::ty_enum(*) | ty::ty_tup(*) => { let llty = sizing_type_of(ccx, ty); llsize_of_alloc(ccx, llty) <= llsize_of_alloc(ccx, ccx.int_type)