mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-13 21:54:42 +00:00
missing match arm add test for partially diverging type
This commit is contained in:
parent
26e5bb0a4e
commit
aec20e5094
1 changed files with 21 additions and 0 deletions
|
@ -1422,6 +1422,27 @@ mod tests {
|
|||
|
||||
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 a new issue