rust/tests/ui/binding/expr-match-unique.rs

10 lines
228 B
Rust
Raw Normal View History

//@ run-pass
2012-08-06 19:34:08 +00:00
// Tests for match as expressions resulting in boxed types
fn test_box() {
let res: Box<_> = match true { true => { Box::new(100) }, _ => panic!() };
2015-01-25 21:05:03 +00:00
assert_eq!(*res, 100);
}
pub fn main() { test_box(); }