missing match arm add test for partially diverging type
This commit is contained in:
parent
26e5bb0a4e
commit
aec20e5094
@ -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)]
|
||||
|
Loading…
Reference in New Issue
Block a user