rust/src/test/ui/pattern/pattern-bindings-after-at.rs
2018-12-25 21:08:33 -07:00

16 lines
277 B
Rust

enum Option<T> {
None,
Some(T),
}
fn main() {
match &mut Some(1) {
ref mut z @ &mut Some(ref a) => {
//~^ ERROR pattern bindings are not allowed after an `@`
**z = None;
println!("{}", *a);
}
_ => ()
}
}