diff options
| author | Brian Koropoff <bkoropoff@gmail.com> | 2014-11-02 19:26:14 -0800 |
|---|---|---|
| committer | Brian Koropoff <bkoropoff@gmail.com> | 2014-11-02 19:31:41 -0800 |
| commit | 1571abae53d77f36352b543a595969f1ef21503b (patch) | |
| tree | 4f252176fe023df2a05b71f44538be5262bfb1f7 | |
| parent | b87619e2744a64da38996c1a618dc28db746848b (diff) | |
| download | rust-1571abae53d77f36352b543a595969f1ef21503b.tar.gz rust-1571abae53d77f36352b543a595969f1ef21503b.zip | |
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
| -rw-r--r-- | src/librustc/middle/typeck/check/mod.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/librustc/middle/typeck/check/mod.rs b/src/librustc/middle/typeck/check/mod.rs index f334d801692..60eefbceded 100644 --- a/src/librustc/middle/typeck/check/mod.rs +++ b/src/librustc/middle/typeck/check/mod.rs @@ -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 { |
