diff options
author | Lukas Wirth <[email protected]> | 2020-11-24 15:46:06 +0000 |
---|---|---|
committer | Lukas Wirth <[email protected]> | 2020-11-24 15:46:06 +0000 |
commit | 4d841dc4e7ebb63fd7060f0c08639e83525c8e4d (patch) | |
tree | 28cf6c71f19293dc0d3995f4746fa48275fdb24d /crates/hir_ty | |
parent | a4b52756562d4f4c9e658d0bca4b3e62ac6ebd95 (diff) |
Add middle ellipsis missing arm text
Diffstat (limited to 'crates/hir_ty')
-rw-r--r-- | crates/hir_ty/src/diagnostics/match_check.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/crates/hir_ty/src/diagnostics/match_check.rs b/crates/hir_ty/src/diagnostics/match_check.rs index 78e207f86..a52f41764 100644 --- a/crates/hir_ty/src/diagnostics/match_check.rs +++ b/crates/hir_ty/src/diagnostics/match_check.rs | |||
@@ -1379,6 +1379,20 @@ fn main() { | |||
1379 | }"#, | 1379 | }"#, |
1380 | ); | 1380 | ); |
1381 | } | 1381 | } |
1382 | |||
1383 | #[test] | ||
1384 | fn tuple_of_bools_with_ellipsis_in_middle_missing_arm() { | ||
1385 | check_diagnostics( | ||
1386 | r#" | ||
1387 | fn main() { | ||
1388 | match (false, true, false) { | ||
1389 | //^^^^^^^^^^^^^^^^^^^^ Missing match arm | ||
1390 | (true, .., false) => (), | ||
1391 | } | ||
1392 | }"#, | ||
1393 | ); | ||
1394 | } | ||
1395 | |||
1382 | mod false_negatives { | 1396 | mod false_negatives { |
1383 | //! The implementation of match checking here is a work in progress. As we roll this out, we | 1397 | //! The implementation of match checking here is a work in progress. As we roll this out, we |
1384 | //! prefer false negatives to false positives (ideally there would be no false positives). This | 1398 | //! prefer false negatives to false positives (ideally there would be no false positives). This |