Add if let test case

This commit is contained in:
Krishna Veera Reddy 2020-01-01 23:22:57 -08:00
parent 84a60c3186
commit 8b36196cb6
2 changed files with 22 additions and 2 deletions

View file

@ -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() {

View file

@ -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() {