about summary refs log tree commit diff
path: root/tests/ui/binding/match-ref-binding-in-guard-3256.rs
blob: 52e2745f2d6e1a0005458782b74f18ef17d1ae35 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
//@ run-pass

use std::sync::Mutex;

pub fn main() {
    let x = Some(Mutex::new(true));
    match x {
        Some(ref z) if *z.lock().unwrap() => {
            assert!(*z.lock().unwrap());
        },
        _ => panic!()
    }
}