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
290 B
Rust
Raw Normal View History

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