Skip to content

Commit

Permalink
Fix ICE when checking call overload
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bkoropoff committed Nov 3, 2014
1 parent b87619e commit 1571aba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/librustc/middle/typeck/check/mod.rs
Expand Up @@ -2536,7 +2536,7 @@ fn check_argument_types<'a>(fcx: &FnCtxt,
span_err!(tcx.sess, sp, E0059,
"cannot use call notation; the first type parameter \
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 {
Expand Down

0 comments on commit 1571aba

Please sign in to comment.