rust/tests/ui/parser/issues/error-pattern-issue-50571.rs
xizheyin ed88af2163
Recover and suggest use ; to construct array type
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-07-15 12:00:46 +08:00

11 lines
267 B
Rust

// There is a regression introduced for issue #143828
//@ edition: 2015
#![allow(dead_code)]
trait Foo {
fn foo([a, b]: [i32; 2]) {}
//~^ ERROR: expected `;` or `]`, found `,`
//~| ERROR: patterns aren't allowed in methods without bodies
}
fn main() {}