mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-01 17:42:47 +00:00
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() {}
|
fn main() {}
|
||||||
|
@ -317,4 +317,13 @@ mod issue10049 {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn test_match_as_stmt() {
|
||||||
|
let x = 9;
|
||||||
|
match x {
|
||||||
|
1 => 2,
|
||||||
|
2 => return,
|
||||||
|
_ => 0,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
fn main() {}
|
fn main() {}
|
||||||
|
Loading…
Reference in New Issue
Block a user