mirror of
https://github.com/rust-lang/rust.git
synced 2026-06-02 15:56:09 +03:00
Allow switching on non-integer types.
This commit is contained in:
+8
-8
@@ -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,
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user