test: add test for match as stmt no triggering needless_return

This commit is contained in:
feniljain 2023-04-05 19:50:12 +05:30
parent c12748fab3
commit b499b7dc73
2 changed files with 18 additions and 0 deletions

View File

@ -307,4 +307,13 @@ mod issue10049 {
}
}
fn test_match_as_stmt() {
let x = 9;
match x {
1 => 2,
2 => return,
_ => 0,
};
}
fn main() {}

View File

@ -317,4 +317,13 @@ fn multiple(b1: bool, b2: bool, b3: bool) -> u32 {
}
}
fn test_match_as_stmt() {
let x = 9;
match x {
1 => 2,
2 => return,
_ => 0,
};
}
fn main() {}