2018-10-02 05:51:02 +00:00
|
|
|
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) => {}
|
2018-11-27 10:56:36 +01:00
|
|
|
//~^ ERROR cannot bind by-move and by-ref in the same pattern
|
2018-10-02 05:51:02 +00:00
|
|
|
}
|
|
|
|
match bar {
|
|
|
|
Bar {a, ref b} => {}
|
2018-11-27 10:56:36 +01:00
|
|
|
//~^ ERROR cannot bind by-move and by-ref in the same pattern
|
2018-10-02 05:51:02 +00:00
|
|
|
}
|
|
|
|
}
|