rust/tests/ui/expr-if-unique.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

10 lines
212 B
Rust
Raw Normal View History

// run-pass
// Tests for if as expressions returning boxed types
fn test_box() {
let rs: Box<_> = if true { Box::new(100) } else { Box::new(101) };
2015-01-25 21:05:03 +00:00
assert_eq!(*rs, 100);
}
pub fn main() { test_box(); }