Skip to content

Commit 251348f

Browse files
MahadMuhammadphilberty
authored andcommitted
gccrs: [E0027] struct pattern fails to specify struct's fields
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 <[email protected]>
1 parent ec0c3ad commit 251348f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

gcc/rust/typecheck/rust-hir-type-check-pattern.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,8 @@ TypeCheckPattern::visit (HIR::StructPattern &pattern)
268268
i++;
269269
}
270270

271-
rust_error_at (pattern.get_locus (), "pattern does not mention fields %s",
271+
rust_error_at (pattern.get_locus (), ErrorCode ("E0027"),
272+
"pattern does not mention fields %s",
272273
missing_fields_str.c_str ());
273274
}
274275
}

0 commit comments

Comments
 (0)