Skip to content

Commit c266c4c

Browse files
Adds some basic test cases
Much more to come as code review progresses.
1 parent acd679c commit c266c4c

File tree

2 files changed

+99
-0
lines changed

2 files changed

+99
-0
lines changed
+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
enum E {
2+
X,
3+
Y
4+
}
5+
enum F {
6+
X2,
7+
Y2
8+
}
9+
struct G {
10+
}
11+
struct H {
12+
}
13+
struct X {}
14+
struct Y {}
15+
struct Z {}
16+
17+
18+
fn invalid(_i: u32) {}
19+
20+
fn extra() {}
21+
22+
fn missing(_i: u32) {}
23+
24+
fn swapped(_i: u32, _s: &str) {}
25+
26+
fn permuted(_x: X, _y: Y, _z: Z) {}
27+
28+
fn complex(_i: u32, _s: &str, _e: E, _f: F, _g: G, _x: X, _y: Y, _z: Z ) {}
29+
30+
fn main() {
31+
invalid(1.0); //~ ERROR arguments to this function are incorrect
32+
extra(&""); //~ ERROR arguments to this function are incorrect
33+
missing(); //~ ERROR arguments to this function are incorrect
34+
swapped(&"", 1); //~ ERROR arguments to this function are incorrect
35+
permuted(Y {}, Z {}, X {}); //~ ERROR arguments to this function are incorrect
36+
complex(1.0, H {}, &"", G{}, F::X2, Z {}, X {}, Y {}); //~ ERROR arguments to this function are incorrect
37+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
error[E0059]: one or more arguments to this function are incorrect
2+
--> $DIR/basic.rs:31:5
3+
|
4+
LL | invalid(1.0);
5+
| ^^^^^^^^---^
6+
| |
7+
| the type of this argument is incorrect
8+
9+
error[E0059]: one or more arguments to this function are incorrect
10+
--> $DIR/basic.rs:32:5
11+
|
12+
LL | extra(&"");
13+
| ^^^^^^---^
14+
| |
15+
| this argument appears to be extra
16+
17+
error[E0059]: one or more arguments to this function are incorrect
18+
--> $DIR/basic.rs:33:5
19+
|
20+
LL | missing();
21+
| ^^^^^^^^^
22+
|
23+
= note: the 1st parameter appears to be missing
24+
25+
error[E0059]: one or more arguments to this function are incorrect
26+
--> $DIR/basic.rs:34:5
27+
|
28+
LL | swapped(&"", 1);
29+
| ^^^^^^^^---^^-^
30+
| | |
31+
| | these two arguments appear to be swapped
32+
| these two arguments appear to be swapped
33+
34+
error[E0059]: one or more arguments to this function are incorrect
35+
--> $DIR/basic.rs:35:5
36+
|
37+
LL | permuted(Y {}, Z {}, X {});
38+
| ^^^^^^^^^----^^----^^----^
39+
| | | |
40+
| | | these 3 arguments appear to be in the wrong order
41+
| | these 3 arguments appear to be in the wrong order
42+
| these 3 arguments appear to be in the wrong order
43+
44+
error[E0059]: one or more arguments to this function are incorrect
45+
--> $DIR/basic.rs:36:5
46+
|
47+
LL | complex(1.0, H {}, &"", G{}, F::X2, Z {}, X {}, Y {});
48+
| ^^^^^^^^---^^----^^^^^^^---^^-----^^----^^----^^----^
49+
| | | | | | | |
50+
| | | | | | | these 3 arguments appear to be in the wrong order
51+
| | | | | | these 3 arguments appear to be in the wrong order
52+
| | | | | these 3 arguments appear to be in the wrong order
53+
| | | | these two arguments appear to be swapped
54+
| | | these two arguments appear to be swapped
55+
| | this argument appears to be extra
56+
| the type of this argument is incorrect
57+
|
58+
= note: the 3rd parameter appears to be missing
59+
60+
error: aborting due to 6 previous errors
61+
62+
For more information about this error, try `rustc --explain E0059`.

0 commit comments

Comments
 (0)