Fix ICE when checking call overload
If the overloaded method does not have a tuple or unit type as its first non-self parameter, produce a list of error types with the correct length to prevent a later index bound panic. This typically occurs due to propagation of an earlier type error or unconstrained type variable. Closes #18532
This commit is contained in:
parent
b87619e274
commit
1571abae53
1 changed files with 1 additions and 1 deletions
|
@ -2536,7 +2536,7 @@ fn check_argument_types<'a>(fcx: &FnCtxt,
|
||||||
span_err!(tcx.sess, sp, E0059,
|
span_err!(tcx.sess, sp, E0059,
|
||||||
"cannot use call notation; the first type parameter \
|
"cannot use call notation; the first type parameter \
|
||||||
for the function trait is neither a tuple nor unit");
|
for the function trait is neither a tuple nor unit");
|
||||||
err_args(supplied_arg_count)
|
err_args(args.len())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if expected_arg_count == supplied_arg_count {
|
} else if expected_arg_count == supplied_arg_count {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue