Skip to content

Commit 1571aba

Browse files
committed
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
1 parent b87619e commit 1571aba

File tree

1 file changed

+1
-1
lines changed
  • src/librustc/middle/typeck/check

1 file changed

+1
-1
lines changed

src/librustc/middle/typeck/check/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2536,7 +2536,7 @@ fn check_argument_types<'a>(fcx: &FnCtxt,
25362536
span_err!(tcx.sess, sp, E0059,
25372537
"cannot use call notation; the first type parameter \
25382538
for the function trait is neither a tuple nor unit");
2539-
err_args(supplied_arg_count)
2539+
err_args(args.len())
25402540
}
25412541
}
25422542
} else if expected_arg_count == supplied_arg_count {

0 commit comments

Comments
 (0)