diff --git a/tests/ui/replace_consts.fixed b/tests/ui/replace_consts.fixed index a8b11c8e488..108474408e0 100644 --- a/tests/ui/replace_consts.fixed +++ b/tests/ui/replace_consts.fixed @@ -76,11 +76,21 @@ fn good() { { let foo = u64::max_value(); }; { let foo = u128::max_value(); }; - let _ = match 42 { + let x = 42; + + let _ = match x { std::i8::MIN => -1, 1..=std::i8::MAX => 1, _ => 0 }; + + let _ = if let std::i8::MIN = x { + -1 + } else if let 1..=std::i8::MAX = x { + 1 + } else { + 0 + }; } fn main() { diff --git a/tests/ui/replace_consts.rs b/tests/ui/replace_consts.rs index fff892b79ca..dae3422a35f 100644 --- a/tests/ui/replace_consts.rs +++ b/tests/ui/replace_consts.rs @@ -76,11 +76,21 @@ fn good() { { let foo = u64::max_value(); }; { let foo = u128::max_value(); }; - let _ = match 42 { + let x = 42; + + let _ = match x { std::i8::MIN => -1, 1..=std::i8::MAX => 1, _ => 0 }; + + let _ = if let std::i8::MIN = x { + -1 + } else if let 1..=std::i8::MAX = x { + 1 + } else { + 0 + }; } fn main() {