]> git.lizzy.rs Git - rust.git/blob - src/test/ui/argument-suggestions/missing_arguments.rs
Auto merge of #103459 - ChrisDenton:propagate-nulls, r=thomcc
[rust.git] / src / test / ui / argument-suggestions / missing_arguments.rs
1 fn one_arg(_a: i32) {}
2 fn two_same(_a: i32, _b: i32) {}
3 fn two_diff(_a: i32, _b: f32) {}
4 fn three_same(_a: i32, _b: i32, _c: i32) {}
5 fn three_diff(_a: i32, _b: f32, _c: &str) {}
6 fn four_repeated(_a: i32, _b: f32, _c: f32, _d: &str) {}
7 fn complex(_a: i32, _b: f32, _c: i32, _d: f32, _e: &str) {}
8
9 fn main() {
10   one_arg(); //~ ERROR this function takes
11   // The headers here show the types expected,
12   // with formatting to emphasize which arguments are missing
13   /*         i32     f32    */
14   two_same(               ); //~ ERROR this function takes
15   two_same(   1           ); //~ ERROR this function takes
16   two_diff(               ); //~ ERROR this function takes
17   two_diff(   1           ); //~ ERROR this function takes
18   two_diff(          1.0  ); //~ ERROR this function takes
19
20   /*           i32     i32     i32    */
21   three_same(                       ); //~ ERROR this function takes
22   three_same(   1                   ); //~ ERROR this function takes
23   three_same(   1,      1           ); //~ ERROR this function takes
24
25   /*           i32     f32     &str   */
26   three_diff(          1.0,     ""  ); //~ ERROR this function takes
27   three_diff(   1,              ""  ); //~ ERROR this function takes
28   three_diff(   1,     1.0          ); //~ ERROR this function takes
29   three_diff(                   ""  ); //~ ERROR this function takes
30   three_diff(          1.0          ); //~ ERROR this function takes
31   three_diff(   1                   ); //~ ERROR this function takes
32
33   /*              i32     f32     f32     &str   */
34   four_repeated(                               ); //~ ERROR this function takes
35   four_repeated(   1,                     ""   ); //~ ERROR this function takes
36
37   /*        i32   f32   i32   f32   &str   */
38   complex(                               ); //~ ERROR this function takes
39   complex(   1,                     ""   ); //~ ERROR this function takes
40 }