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

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

15 lines
289 B
Rust
Raw Normal View History

// run-pass
2011-05-13 13:42:23 -05:00
fn test_simple() {
let r = match true { true => { true } false => { panic!() } };
assert_eq!(r, true);
2011-05-13 13:42:23 -05:00
}
fn test_box() {
let r = match true { true => { vec![10] } false => { panic!() } };
2015-01-25 15:05:03 -06:00
assert_eq!(r[0], 10);
2011-05-13 13:42:23 -05:00
}
pub fn main() { test_simple(); test_box(); }