From 4d841dc4e7ebb63fd7060f0c08639e83525c8e4d Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Tue, 24 Nov 2020 16:46:06 +0100 Subject: Add middle ellipsis missing arm text --- crates/hir_ty/src/diagnostics/match_check.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'crates/hir_ty/src') 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() { }"#, ); } + + #[test] + fn tuple_of_bools_with_ellipsis_in_middle_missing_arm() { + check_diagnostics( + r#" +fn main() { + match (false, true, false) { + //^^^^^^^^^^^^^^^^^^^^ Missing match arm + (true, .., false) => (), + } +}"#, + ); + } + mod false_negatives { //! The implementation of match checking here is a work in progress. As we roll this out, we //! prefer false negatives to false positives (ideally there would be no false positives). This -- cgit v1.2.3