about summary refs log tree commit diff
path: root/src/test/run-pass/reference-branch.rs
blob: 7c5d0c660f74ab41ad29d5bd723ba71a62c9ed58 (plain)
1
2
3
4
5
6
7
8
9
// Ensures that invalidating a reference in one branch doesn't
// influence other branches.

fn main() {
    let x = [];
    let &y = x;
    if true { x = [1]; }
    else { log_err y; }
}