mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-30 04:56:25 +03:00
missing match arm add test for partially diverging type
This commit is contained in:
@@ -1422,6 +1422,27 @@ fn test_fn() {
|
||||
|
||||
check_no_diagnostic(content);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn expr_partially_diverges() {
|
||||
let content = r"
|
||||
enum Either<T> {
|
||||
A(T),
|
||||
B,
|
||||
}
|
||||
fn foo() -> Either<!> {
|
||||
Either::B
|
||||
}
|
||||
fn test_fn() -> u32 {
|
||||
match foo() {
|
||||
Either::A(val) => val,
|
||||
Either::B => 0,
|
||||
}
|
||||
}
|
||||
";
|
||||
|
||||
check_no_diagnostic(content);
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
Reference in New Issue
Block a user