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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

21 lines
483 B
Rust
Raw Normal View History

2020-07-02 00:32:12 -05:00
// run-rustfix
#![allow(unused)] // for rustfix
2018-08-11 15:25:48 -05: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 15:25:48 -05:00
fn f(&ident: &S) {} // ok
fn g(&&ident: &&S) {} // ok
fn h(mut ident: S) {} // ok
}
fn main() {}