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

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

10 lines
227 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(); }