]> git.lizzy.rs Git - rust.git/blob - src/test/ui/error-codes/E0642.rs
Merge commit 'd3a2366ee877075c59b38bd8ced55f224fc7ef51' into sync_cg_clif-2022-07-26
[rust.git] / src / test / ui / error-codes / E0642.rs
1 // run-rustfix
2
3 #![allow(unused)] // for rustfix
4
5 #[derive(Clone, Copy)]
6 struct S;
7
8 trait T {
9     fn foo((x, y): (i32, i32)); //~ ERROR patterns aren't allowed in methods without bodies
10
11     fn bar((x, y): (i32, i32)) {} //~ ERROR patterns aren't allowed in methods without bodies
12
13     fn method(S { .. }: S) {} //~ ERROR patterns aren't allowed in methods without bodies
14
15     fn f(&ident: &S) {} // ok
16     fn g(&&ident: &&S) {} // ok
17     fn h(mut ident: S) {} // ok
18 }
19
20 fn main() {}