Allow switching on non-integer types.

This commit is contained in:
Scott Olson 2016-03-13 04:50:16 -06:00
parent 96c51dc8ed
commit cc8b8efd33
3 changed files with 13 additions and 14 deletions

View file

@ -16,11 +16,11 @@ fn if_true() -> i64 {
if true { 1 } else { 0 }
}
// #[miri_run]
// fn match_bool() -> i64 {
// let b = true;
// match b {
// true => 1,
// false => 0,
// }
// }
#[miri_run]
fn match_bool() -> i16 {
let b = true;
match b {
true => 1,
_ => 0,
}
}

View file

@ -24,13 +24,13 @@ fn indirect_add() -> i64 {
}
#[miri_run]
fn arith() -> i64 {
fn arith() -> i32 {
3*3 + 4*4
}
#[miri_run]
fn match_int() -> i64 {
let n = 2i64;
fn match_int() -> i16 {
let n = 2;
match n {
0 => 0,
1 => 10,