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() {
76
76
{ let foo = u64::max_value(); };
77
77
{ let foo = u128::max_value(); };
78
78
79
- let _ = match 42 {
79
+ let x = 42;
80
+
81
+ let _ = match x {
80
82
std::i8::MIN => -1,
81
83
1..=std::i8::MAX => 1,
82
84
_ => 0
83
85
};
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
+ };
84
94
}
85
95
86
96
fn main() {
Original file line number Diff line number Diff line change @@ -76,11 +76,21 @@ fn good() {
76
76
{ let foo = u64:: max_value ( ) ; } ;
77
77
{ let foo = u128:: max_value ( ) ; } ;
78
78
79
- let _ = match 42 {
79
+ let x = 42 ;
80
+
81
+ let _ = match x {
80
82
std:: i8:: MIN => -1 ,
81
83
1 ..=std:: i8:: MAX => 1 ,
82
84
_ => 0
83
85
} ;
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
+ } ;
84
94
}
85
95
86
96
fn main ( ) {
You can’t perform that action at this time.
0 commit comments