2012-03-29 00:01:42 +00:00
|
|
|
// Check that the only error msg we report is the
|
|
|
|
// mismatch between the # of params, and not other
|
|
|
|
// unrelated errors.
|
|
|
|
|
2015-01-08 10:54:35 +00:00
|
|
|
fn foo(a: isize, b: isize, c: isize, d:isize) {
|
2014-10-09 19:17:22 +00:00
|
|
|
panic!();
|
2012-03-29 00:01:42 +00:00
|
|
|
}
|
|
|
|
|
2020-09-24 02:43:32 +00:00
|
|
|
// Check that all arguments are shown in the error message, even if they're across multiple lines.
|
|
|
|
fn bar(
|
|
|
|
a: i32,
|
|
|
|
b: i32,
|
|
|
|
c: i32,
|
|
|
|
d: i32,
|
|
|
|
e: i32,
|
|
|
|
f: i32,
|
|
|
|
) {
|
|
|
|
println!("{}", a);
|
|
|
|
println!("{}", b);
|
|
|
|
println!("{}", c);
|
|
|
|
println!("{}", d);
|
|
|
|
println!("{}", e);
|
|
|
|
println!("{}", f);
|
|
|
|
}
|
|
|
|
|
2012-03-29 00:01:42 +00:00
|
|
|
fn main() {
|
|
|
|
foo(1, 2, 3);
|
2023-01-05 03:02:10 +00:00
|
|
|
//~^ ERROR function takes 4 arguments but 3
|
2020-09-24 02:43:32 +00:00
|
|
|
bar(1, 2, 3);
|
2023-01-05 03:02:10 +00:00
|
|
|
//~^ ERROR function takes 6 arguments but 3
|
2012-03-29 00:01:42 +00:00
|
|
|
}
|