]> git.lizzy.rs Git - rust.git/blob - src/test/ui/argument-suggestions/extra_arguments.rs
Auto merge of #106025 - matthiaskrgr:rollup-vz5rqah, r=matthiaskrgr
[rust.git] / src / test / ui / argument-suggestions / extra_arguments.rs
1 fn empty() {}
2 fn one_arg(_a: i32) {}
3 fn two_arg_same(_a: i32, _b: i32) {}
4 fn two_arg_diff(_a: i32, _b: &str) {}
5
6 fn main() {
7   empty(""); //~ ERROR this function takes
8
9   one_arg(1, 1); //~ ERROR this function takes
10   one_arg(1, ""); //~ ERROR this function takes
11   one_arg(1, "", 1.0); //~ ERROR this function takes
12
13   two_arg_same(1, 1, 1); //~ ERROR this function takes
14   two_arg_same(1, 1, 1.0); //~ ERROR this function takes
15
16   two_arg_diff(1, 1, ""); //~ ERROR this function takes
17   two_arg_diff(1, "", ""); //~ ERROR this function takes
18   two_arg_diff(1, 1, "", ""); //~ ERROR this function takes
19   two_arg_diff(1, "", 1, ""); //~ ERROR this function takes
20
21   // Check with weird spacing and newlines
22   two_arg_same(1, 1,     ""); //~ ERROR this function takes
23   two_arg_diff(1, 1,     ""); //~ ERROR this function takes
24   two_arg_same( //~ ERROR this function takes
25     1,
26     1,
27     ""
28   );
29
30   two_arg_diff( //~ ERROR this function takes
31     1,
32     1,
33     ""
34   );
35 }