summary refs log tree commit diff
path: root/src/test/run-pass/borrowck/two-phase-control-flow-split-before-activation.rs
blob: 9759223a1ba4e8fac3f41ad0139c49b5e28e5813 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// run-pass
// revisions: lxl nll
//[lxl]compile-flags: -Z borrowck=mir -Z two-phase-borrows

#![cfg_attr(nll, feature(nll))]

fn main() {
    let mut a = 0;
    let mut b = 0;
    let p = if maybe() {
        &mut a
    } else {
        &mut b
    };
    use_(p);
}

fn maybe() -> bool { false }
fn use_<T>(_: T) { }