PageRenderTime 22ms CodeModel.GetById 15ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/src/test/run-pass/expr-elseif-ref.rs

http://github.com/jruderman/rust
Rust | 7 lines | 5 code | 0 blank | 2 comment | 5 complexity | a09219754745bff14e63386d32260a15 MD5 | raw file
1// Make sure we drop the refs of the temporaries needed to return the
2// values from the else if branch
3fn main() {
4    let y: @uint = @10u;
5    let x = if false { y } else if true { y } else { y };
6    assert (*y == 10u);
7}