]> git.lizzy.rs Git - rust.git/blob - src/test/ui/argument-suggestions/basic.rs
Make some diagnostics not depend on the source of what they reference being available
[rust.git] / src / test / ui / argument-suggestions / basic.rs
1 // Some basic "obvious" cases for the heuristic error messages added for #65853
2 // One for each of the detected cases
3
4 enum E { X, Y }
5 enum F { X2, Y2 }
6 struct G {}
7 struct H {}
8 struct X {}
9 struct Y {}
10 struct Z {}
11
12
13 fn invalid(_i: u32) {}
14 fn extra() {}
15 fn missing(_i: u32) {}
16 fn swapped(_i: u32, _s: &str) {}
17 fn permuted(_x: X, _y: Y, _z: Z) {}
18
19 fn main() {
20     invalid(1.0); //~ ERROR mismatched types
21     extra(""); //~ ERROR this function takes
22     missing(); //~ ERROR this function takes
23     swapped("", 1); //~ ERROR arguments to this function are incorrect
24     permuted(Y {}, Z {}, X {}); //~ ERROR arguments to this function are incorrect
25
26     let closure = |x| x;
27     closure(); //~ ERROR this function takes
28 }