summaryrefslogtreecommitdiffstats
path: root/src/test/ui/argument-suggestions/swapped_arguments.rs
blob: a21de610c6a1320820b7f6930809f9e42b542d1a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
struct X {}

fn two_args(_a: i32, _b: f32) {}
fn three_args(_a: i32, _b: f32, _c: &str) {}
fn four_args(_a: i32, _b: f32, _c: &str, _d: X) {}

fn main() {
  two_args(1.0, 1); //~ ERROR arguments to this function are incorrect
  three_args(1.0,   1,  ""); //~ ERROR arguments to this function are incorrect
  three_args(  1,  "", 1.0); //~ ERROR arguments to this function are incorrect
  three_args( "", 1.0,   1); //~ ERROR arguments to this function are incorrect

  four_args(1.0, 1, X {}, ""); //~ ERROR arguments to this function are incorrect
}