File tree Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -76,11 +76,21 @@ fn good() {
7676 { let foo = u64::max_value(); };
7777 { let foo = u128::max_value(); };
7878
79- let _ = match 42 {
79+ let x = 42;
80+
81+ let _ = match x {
8082 std::i8::MIN => -1,
8183 1..=std::i8::MAX => 1,
8284 _ => 0
8385 };
86+
87+ let _ = if let std::i8::MIN = x {
88+ -1
89+ } else if let 1..=std::i8::MAX = x {
90+ 1
91+ } else {
92+ 0
93+ };
8494}
8595
8696fn main() {
Original file line number Diff line number Diff line change @@ -76,11 +76,21 @@ fn good() {
7676 { let foo = u64:: max_value ( ) ; } ;
7777 { let foo = u128:: max_value ( ) ; } ;
7878
79- let _ = match 42 {
79+ let x = 42 ;
80+
81+ let _ = match x {
8082 std:: i8:: MIN => -1 ,
8183 1 ..=std:: i8:: MAX => 1 ,
8284 _ => 0
8385 } ;
86+
87+ let _ = if let std:: i8:: MIN = x {
88+ -1
89+ } else if let 1 ..=std:: i8:: MAX = x {
90+ 1
91+ } else {
92+ 0
93+ } ;
8494}
8595
8696fn main ( ) {
You can’t perform that action at this time.
0 commit comments