]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: [E0027] struct pattern fails to specify struct's fields
authorMuhammad Mahad <mahadtxt@gmail.com>
Tue, 27 Jun 2023 12:08:59 +0000 (17:08 +0500)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 17:49:30 +0000 (18:49 +0100)
A pattern for a struct fails to specify a sub-pattern
for every one of the struct's fields. - pattern does
not mention fields `x`, `y`

gcc/rust/ChangeLog:
* typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit): called rust_error_at

Signed-off-by: Muhammad Mahad <mahadtxt@gmail.com>
gcc/rust/typecheck/rust-hir-type-check-pattern.cc

index a740805fb7fbf9cd40f4876475e3da1f32efc0e5..b407e1f40056410ded3fc0477be787c99410d5b5 100644 (file)
@@ -268,7 +268,8 @@ TypeCheckPattern::visit (HIR::StructPattern &pattern)
          i++;
        }
 
-      rust_error_at (pattern.get_locus (), "pattern does not mention fields %s",
+      rust_error_at (pattern.get_locus (), ErrorCode ("E0027"),
+                    "pattern does not mention fields %s",
                     missing_fields_str.c_str ());
     }
 }