Skip to content

Commit 2100b10

Browse files
committed
Treat struct(T) the same as struct S { x: T } WRT being immediate args
Currently we pass a `struct S(u64)` as an immediate value on i686, but a `struct S { x: u64 }` is passed indirectly. This seems pretty wrong, as they both have the same underlying LLVM type `{ i64 }`, no sense in treating them differently.
1 parent 6354d60 commit 2100b10

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/librustc_trans/trans/common.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -222,10 +222,7 @@ fn type_is_newtype_immediate<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
222222
match ty.sty {
223223
ty::ty_struct(def_id, substs) => {
224224
let fields = ty::struct_fields(ccx.tcx(), def_id, substs);
225-
fields.len() == 1 &&
226-
fields[0].name ==
227-
token::special_idents::unnamed_field.name &&
228-
type_is_immediate(ccx, fields[0].mt.ty)
225+
fields.len() == 1 && type_is_immediate(ccx, fields[0].mt.ty)
229226
}
230227
_ => false
231228
}

0 commit comments

Comments
 (0)