Skip to content

Commit 5711a2a

Browse files
MahadMuhammadphilberty
authored andcommitted
gccrs: [E0023] Incorrect Number of Fields in Pattern Extraction
ErrorCode[E0023]: Incorrect Number of Fields in Pattern Extraction. The pattern has x fields, but the corresponding tuple variant has y field 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 f56fd7e commit 5711a2a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ TypeCheckPattern::visit (HIR::TupleStructPattern &pattern)
112112
if (items_no_range.get_patterns ().size () != variant->num_fields ())
113113
{
114114
rust_error_at (
115-
pattern.get_locus (),
115+
pattern.get_locus (), ErrorCode ("E0023"),
116116
"this pattern has %lu fields but the corresponding "
117117
"tuple variant has %lu field",
118118
(unsigned long) items_no_range.get_patterns ().size (),

0 commit comments

Comments
 (0)