rust/tests/ui/error-codes/E0642.rs

21 lines
483 B
Rust
Raw Normal View History

2020-07-02 05:32:12 +00:00
// run-rustfix
#![allow(unused)] // for rustfix
2018-08-11 20:25:48 +00:00
#[derive(Clone, Copy)]
struct S;
trait T {
fn foo((x, y): (i32, i32)); //~ ERROR patterns aren't allowed in methods without bodies
fn bar((x, y): (i32, i32)) {} //~ ERROR patterns aren't allowed in methods without bodies
fn method(S { .. }: S) {} //~ ERROR patterns aren't allowed in methods without bodies
2018-08-11 20:25:48 +00:00
fn f(&ident: &S) {} // ok
fn g(&&ident: &&S) {} // ok
fn h(mut ident: S) {} // ok
}
fn main() {}