Fix a numerical underflow in tuple wrap suggestion
This commit is contained in:
@@ -575,6 +575,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
||||
// If so, we might have just forgotten to wrap some args in a tuple.
|
||||
if let Some(ty::Tuple(tys)) =
|
||||
formal_and_expected_inputs.get(mismatch_idx.into()).map(|tys| tys.1.kind())
|
||||
// If the tuple is unit, we're not actually wrapping any arguments.
|
||||
&& !tys.is_empty()
|
||||
&& provided_arg_tys.len() == formal_and_expected_inputs.len() - 1 + tys.len()
|
||||
{
|
||||
// Wrap up the N provided arguments starting at this position in a tuple.
|
||||
|
||||
Reference in New Issue
Block a user