diff options
Diffstat (limited to 'crates')
-rw-r--r-- | crates/ra_hir_ty/src/_match.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/crates/ra_hir_ty/src/_match.rs b/crates/ra_hir_ty/src/_match.rs index 4be08e9a3..596194dcf 100644 --- a/crates/ra_hir_ty/src/_match.rs +++ b/crates/ra_hir_ty/src/_match.rs | |||
@@ -1422,6 +1422,27 @@ mod tests { | |||
1422 | 1422 | ||
1423 | check_no_diagnostic(content); | 1423 | check_no_diagnostic(content); |
1424 | } | 1424 | } |
1425 | |||
1426 | #[test] | ||
1427 | fn expr_partially_diverges() { | ||
1428 | let content = r" | ||
1429 | enum Either<T> { | ||
1430 | A(T), | ||
1431 | B, | ||
1432 | } | ||
1433 | fn foo() -> Either<!> { | ||
1434 | Either::B | ||
1435 | } | ||
1436 | fn test_fn() -> u32 { | ||
1437 | match foo() { | ||
1438 | Either::A(val) => val, | ||
1439 | Either::B => 0, | ||
1440 | } | ||
1441 | } | ||
1442 | "; | ||
1443 | |||
1444 | check_no_diagnostic(content); | ||
1445 | } | ||
1425 | } | 1446 | } |
1426 | 1447 | ||
1427 | #[cfg(test)] | 1448 | #[cfg(test)] |