missing match arm add test for partially diverging type

This commit is contained in:
Josh Mcguigan 2020-04-11 07:13:47 -07:00
parent 26e5bb0a4e
commit aec20e5094

View File

@ -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)]