提交 1571abae 编写于 作者: B Brian Koropoff

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
上级 b87619e2
...@@ -2536,7 +2536,7 @@ fn check_argument_types<'a>(fcx: &FnCtxt, ...@@ -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 {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册