about summary refs log tree commit diff
path: root/src/test/ui/writealias.rs
blob: 8ba4b09ae29858d49eb3f2385954690167360428 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// run-pass

#![allow(dead_code)]

use std::sync::Mutex;

struct Point {x: isize, y: isize, z: isize}

fn f(p: &mut Point) { p.z = 13; }

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