summaryrefslogtreecommitdiff
path: root/src/test/ui/E0642.rs
blob: cfbd362c1da1995812f3fdd3c1926d3693d4ab01 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#[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

    fn f(&ident: &S) {} // ok
    fn g(&&ident: &&S) {} // ok
    fn h(mut ident: S) {} // ok
}

fn main() {}