about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBrian Koropoff <bkoropoff@gmail.com>2014-11-02 19:26:14 -0800
committerBrian Koropoff <bkoropoff@gmail.com>2014-11-02 19:31:41 -0800
commit1571abae53d77f36352b543a595969f1ef21503b (patch)
tree4f252176fe023df2a05b71f44538be5262bfb1f7
parentb87619e2744a64da38996c1a618dc28db746848b (diff)
downloadrust-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.rs2
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 {