about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-02-19 10:34:31 -0800
committerbors <bors@rust-lang.org>2013-02-19 10:34:31 -0800
commita782efc4f16fed52f1f82af5869bfb5285bbc3f4 (patch)
tree92ae442b5b0e758b2469fcb419d499ed374e4787
parentf68335113bf277f171494abb62a31293311f80c8 (diff)
parentf513c567cb5b02a514af3903941434efd0b8a5eb (diff)
downloadrust-a782efc4f16fed52f1f82af5869bfb5285bbc3f4.tar.gz
rust-a782efc4f16fed52f1f82af5869bfb5285bbc3f4.zip
auto merge of #5032 : lifthrasiir/rust/issue-4935, r=catamorphism
Actually a trivial fix. Fixes the issue #4935.
-rw-r--r--src/librustc/middle/typeck/check/mod.rs2
-rw-r--r--src/test/compile-fail/issue-4935.rs14
2 files changed, 15 insertions, 1 deletions
diff --git a/src/librustc/middle/typeck/check/mod.rs b/src/librustc/middle/typeck/check/mod.rs
index 1ad3bd9cae6..8f8eb893622 100644
--- a/src/librustc/middle/typeck/check/mod.rs
+++ b/src/librustc/middle/typeck/check/mod.rs
@@ -1198,7 +1198,7 @@ pub fn check_expr_with_unifier(fcx: @mut FnCtxt,
 
                     tcx.sess.span_err(sp, msg);
 
-                    vec::from_fn(expected_arg_count, |_| ty::mk_err(tcx))
+                    vec::from_fn(supplied_arg_count, |_| ty::mk_err(tcx))
                 };
 
                 sig.output
diff --git a/src/test/compile-fail/issue-4935.rs b/src/test/compile-fail/issue-4935.rs
new file mode 100644
index 00000000000..4bb3a511944
--- /dev/null
+++ b/src/test/compile-fail/issue-4935.rs
@@ -0,0 +1,14 @@
+// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// Regresion test for issue #4935
+
+fn foo(a: uint) {}
+fn main() { foo(5, 6) } //~ ERROR this function takes 1 parameter but 2 parameters were supplied