rust/src/test/ui/issues/issue-53840.rs
2018-12-25 21:08:33 -07:00

21 lines
434 B
Rust

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
}
}