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

7 lines
234 B
Rust
Raw Normal View History

// Make sure we drop the refs of the temporaries needed to return the
// values from the else if branch
fn main() {
2011-07-27 07:19:39 -05:00
let y: vec[uint] = [10u];
let x = if false { y } else if (true) { y } else { y };
assert (y.(0) == 10u);
}