about summary refs log tree commit diff
path: root/src/test/run-pass/expr-elseif-ref.rs
blob: 4235c21ac5fe5e209cd89f12fb2a7ed670f786e5 (plain)
1
2
3
4
5
6
7
// Make sure we drop the refs of the temporaries needed to return the
// values from the else if branch
fn main() {
    let y: @uint = @10u;
    let x = if false { y } else if true { y } else { y };
    assert (*y == 10u);
}