Skip to content

Commit 576c215

Browse files
committed
Add test for #50571
1 parent 22bc9e1 commit 576c215

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

src/test/ui/issues/issue-50571.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
trait Foo {
2+
fn foo([a, b]: [i32; 2]) {}
3+
//~^ ERROR: patterns aren't allowed in methods without bodies
4+
}
5+
6+
fn main() {}

src/test/ui/issues/issue-50571.stderr

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
error[E0642]: patterns aren't allowed in methods without bodies
2+
--> $DIR/issue-50571.rs:2:12
3+
|
4+
LL | fn foo([a, b]: [i32; 2]) {}
5+
| ^^^^^^
6+
help: give this argument a name or use an underscore to ignore it
7+
|
8+
LL | fn foo(_: [i32; 2]) {}
9+
| ^
10+
11+
error: aborting due to previous error
12+
13+
For more information about this error, try `rustc --explain E0642`.

0 commit comments

Comments
 (0)