summary refs log tree commit diff
path: root/src/test/ui/issues/issue-53840.rs
blob: e854d24ab9756b122140612ec31cd1a7fa5343d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
enum E {
    Foo(String, String, String),
}

struct Bar {
    a: String,
    b: String,
}

fn main() {
    let bar = Bar { a: "1".to_string(), b: "2".to_string() };
    match E::Foo("".into(), "".into(), "".into()) {
        E::Foo(a, b, ref c) => {}
//~^ ERROR cannot bind by-move and by-ref in the same pattern
    }
    match bar {
        Bar {a, ref b} => {}
//~^ ERROR cannot bind by-move and by-ref in the same pattern
    }
}