Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit c1efc33

Browse files
committed
Fix panic
1 parent e8f1c5c commit c1efc33

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/common.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,12 @@ fn clif_pair_type_from_ty<'tcx>(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>) -> Option<(type
8383
Some(match ty.kind {
8484
ty::Tuple(substs) if substs.len() == 2 => {
8585
let mut types = substs.types();
86-
(
87-
clif_type_from_ty(tcx, types.next().unwrap())?,
88-
clif_type_from_ty(tcx, types.next().unwrap())?,
89-
)
86+
let a = clif_type_from_ty(tcx, types.next().unwrap())?;
87+
let b = clif_type_from_ty(tcx, types.next().unwrap())?;
88+
if a.is_vector() || b.is_vector() {
89+
return None;
90+
}
91+
(a, b)
9092
}
9193
ty::RawPtr(TypeAndMut { ty: pointee_ty, mutbl: _ }) | ty::Ref(_, pointee_ty, _) => {
9294
if has_ptr_meta(tcx, pointee_ty) {

0 commit comments

Comments
 (0)