summary refs log tree commit diff
path: root/src/test/ui/pattern/pattern-bindings-after-at.rs
blob: 20a1d017cdd1818f09b2aa48f47b0dd13993eff8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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 `@`
        //~| WARN cannot borrow `_` as immutable because it is also borrowed as mutable
        //~| WARN this error has been downgraded to a warning for backwards compatibility
        //~| WARN this represents potential undefined behavior in your code and this warning will
            **z = None;
            println!("{}", *a);
        }
        _ => ()
    }
}