]> git.lizzy.rs Git - rust.git/commitdiff
Add middle ellipsis missing arm text
authorLukas Wirth <lukastw97@gmail.com>
Tue, 24 Nov 2020 15:46:06 +0000 (16:46 +0100)
committerLukas Wirth <lukastw97@gmail.com>
Tue, 24 Nov 2020 15:46:06 +0000 (16:46 +0100)
crates/hir_ty/src/diagnostics/match_check.rs

index 78e207f865dfd74e3f41b93342a72856452a4261..a52f41764be355e45656a343693aa0842a1ff367 100644 (file)
@@ -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