Skip to content

Commit a782efc

Browse files
committed
auto merge of #5032 : lifthrasiir/rust/issue-4935, r=catamorphism
Actually a trivial fix. Fixes the issue #4935.
2 parents f683351 + f513c56 commit a782efc

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

src/librustc/middle/typeck/check/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1198,7 +1198,7 @@ pub fn check_expr_with_unifier(fcx: @mut FnCtxt,
11981198

11991199
tcx.sess.span_err(sp, msg);
12001200

1201-
vec::from_fn(expected_arg_count, |_| ty::mk_err(tcx))
1201+
vec::from_fn(supplied_arg_count, |_| ty::mk_err(tcx))
12021202
};
12031203

12041204
sig.output

src/test/compile-fail/issue-4935.rs

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// Regresion test for issue #4935
12+
13+
fn foo(a: uint) {}
14+
fn main() { foo(5, 6) } //~ ERROR this function takes 1 parameter but 2 parameters were supplied

0 commit comments

Comments
 (0)