Skip to content

Commit 4b26d41

Browse files
add regression test
1 parent fc93461 commit 4b26d41

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
struct A;
2+
struct B;
3+
struct C;
4+
struct D;
5+
struct E;
6+
struct F;
7+
struct G;
8+
9+
fn foo(a: &A, d: D, e: &E, g: G) {}
10+
11+
fn main() {
12+
foo(&&A, B, C, D, E, F, G);
13+
//~^ ERROR this function takes 4 arguments but 7 arguments were supplied
14+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
error[E0061]: this function takes 4 arguments but 7 arguments were supplied
2+
--> $DIR/issue-97484.rs:12:5
3+
|
4+
LL | foo(&&A, B, C, D, E, F, G);
5+
| ^^^ - - - argument unexpected
6+
| | |
7+
| | argument of type `&E` unexpected
8+
| argument of type `D` unexpected
9+
|
10+
note: function defined here
11+
--> $DIR/issue-97484.rs:9:4
12+
|
13+
LL | fn foo(a: &A, d: D, e: &E, g: G) {}
14+
| ^^^ ----- ---- ----- ----
15+
help: consider removing the ``
16+
|
17+
LL - foo(&&A, B, C, D, E, F, G);
18+
LL + foo(&&A, B, C, D, E, F, G);
19+
|
20+
help: remove the extra arguments
21+
|
22+
LL | foo(&&A, D, {&E}, G);
23+
| ~~~~~~~~~~~~~~~~~~~~
24+
25+
error: aborting due to previous error
26+
27+
For more information about this error, try `rustc --explain E0061`.

0 commit comments

Comments
 (0)