Skip to content

Commit e35eb91

Browse files
committed
Fix tuple_array_conversions lint on nightly
1 parent fc1152a commit e35eb91

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clippy_lints/src/tuple_array_conversions.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,8 @@ fn all_bindings_are_for_conv<'tcx>(
189189
tys.len() == elements.len() && tys.iter().chain(final_tys.iter().copied()).all_equal()
190190
},
191191
(ToType::Tuple, ty::Array(ty, len)) => {
192-
len.eval_target_usize(cx.tcx, cx.param_env) as usize == elements.len()
193-
&& final_tys.iter().chain(once(ty)).all_equal()
192+
let Some(len) = len.try_eval_target_usize(cx.tcx, cx.param_env) else { return false };
193+
len as usize == elements.len() && final_tys.iter().chain(once(ty)).all_equal()
194194
},
195195
_ => false,
196196
}

0 commit comments

Comments
 (0)