Skip to content

Commit d34bcdd

Browse files
committed
use List<Ty<'tcx>> for tuples
1 parent 7e80bc3 commit d34bcdd

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/abi/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ impl<'tcx> FunctionCx<'_, '_, 'tcx> {
117117
.unzip();
118118
let return_layout = self.layout_of(return_ty);
119119
let return_tys = if let ty::Tuple(tup) = return_ty.kind() {
120-
tup.types().map(|ty| AbiParam::new(self.clif_type(ty).unwrap())).collect()
120+
tup.iter().map(|ty| AbiParam::new(self.clif_type(ty).unwrap())).collect()
121121
} else {
122122
vec![AbiParam::new(self.clif_type(return_ty).unwrap())]
123123
};
@@ -199,7 +199,7 @@ pub(crate) fn codegen_fn_prelude<'tcx>(fx: &mut FunctionCx<'_, '_, 'tcx>, start_
199199
};
200200

201201
let mut params = Vec::new();
202-
for (i, _arg_ty) in tupled_arg_tys.types().enumerate() {
202+
for (i, _arg_ty) in tupled_arg_tys.iter().enumerate() {
203203
let arg_abi = arg_abis_iter.next().unwrap();
204204
let param =
205205
cvalue_for_param(fx, Some(local), Some(i), arg_abi, &mut block_params_iter);

src/common.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,9 @@ fn clif_pair_type_from_ty<'tcx>(
9090
ty: Ty<'tcx>,
9191
) -> Option<(types::Type, types::Type)> {
9292
Some(match ty.kind() {
93-
ty::Tuple(substs) if substs.len() == 2 => {
94-
let mut types = substs.types();
95-
let a = clif_type_from_ty(tcx, types.next().unwrap())?;
96-
let b = clif_type_from_ty(tcx, types.next().unwrap())?;
93+
ty::Tuple(types) if types.len() == 2 => {
94+
let a = clif_type_from_ty(tcx, types[0])?;
95+
let b = clif_type_from_ty(tcx, types[1])?;
9796
if a.is_vector() || b.is_vector() {
9897
return None;
9998
}

0 commit comments

Comments
 (0)