]> git.lizzy.rs Git - rust.git/blobdiff - src/test/compile-fail/non-exhaustive-pattern-witness.rs
auto merge of #15421 : catharsis/rust/doc-ffi-minor-fixes, r=alexcrichton
[rust.git] / src / test / compile-fail / non-exhaustive-pattern-witness.rs
index d0f51bf2da43b8d8c0c0628061875c20a054feab..6dc5ad8b606c37e7055f17596f5db1b43def01f0 100644 (file)
@@ -23,7 +23,7 @@ enum Color {
 
 fn struct_with_a_nested_enum_and_vector() {
     match (Foo { first: true, second: None }) {
-    //~^ ERROR non-exhaustive patterns: `Foo{first: false, second: Some([_, _, _, _])}` not covered
+//~^ ERROR non-exhaustive patterns: `Foo { first: false, second: Some([_, _, _, _]) }` not covered
         Foo { first: true, second: None } => (),
         Foo { first: true, second: Some(_) } => (),
         Foo { first: false, second: None } => (),
@@ -40,7 +40,7 @@ fn enum_with_multiple_missing_variants() {
 
 fn enum_struct_variant() {
     match Red {
-    //~^ ERROR non-exhaustive patterns: `CustomRGBA{a: true, r: _, g: _, b: _}` not covered
+    //~^ ERROR non-exhaustive patterns: `CustomRGBA { a: true, .. }` not covered
         Red => (),
         Green => (),
         CustomRGBA { a: false, r: _, g: _, b: 0 } => (),
@@ -67,8 +67,11 @@ fn vectors_with_nested_enums() {
     }
 }
 
-fn main() {
-    struct_with_a_nested_enum_and_vector();
-    enum_with_multiple_missing_variants();
-    enum_struct_variant();
+fn missing_nil() {
+    match ((), false) {
+    //~^ ERROR non-exhaustive patterns: `((), false)` not covered
+        ((), true) => ()
+    }
 }
+
+fn main() {}