test: add test for match as stmt no triggering needless_return
This commit is contained in:
parent
c12748fab3
commit
b499b7dc73
@ -307,4 +307,13 @@ mod issue10049 {
|
||||
}
|
||||
}
|
||||
|
||||
fn test_match_as_stmt() {
|
||||
let x = 9;
|
||||
match x {
|
||||
1 => 2,
|
||||
2 => return,
|
||||
_ => 0,
|
||||
};
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
@ -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() {}
|
||||
|
Loading…
Reference in New Issue
Block a user