Rollup merge of #99483 - compiler-errors:issue-99482, r=jyn514
Fix a numerical underflow in tuple wrap suggestion Fixes #99482 I'm a clown, I rewrote the arg mismatch algo to use well-typed indices to avoid things like this, but then I added my own indexing bug, lol.
This commit is contained in:
commit
d9a71c1e02
3 changed files with 26 additions and 0 deletions
|
@ -573,6 +573,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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue