Skip to content

Commit

Permalink
gccrs: [E0023] Incorrect Number of Fields in Pattern Extraction
Browse files Browse the repository at this point in the history
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 <mahadtxt@gmail.com>
  • Loading branch information
MahadMuhammad committed Jun 26, 2023
1 parent ac43e58 commit 528c948
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gcc/rust/typecheck/rust-hir-type-check-pattern.cc
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ TypeCheckPattern::visit (HIR::TupleStructPattern &pattern)
if (items_no_range.get_patterns ().size () != variant->num_fields ())
{
rust_error_at (
pattern.get_locus (),
pattern.get_locus (), ErrorCode ("E0023"),
"this pattern has %lu fields but the corresponding "
"tuple variant has %lu field",
(unsigned long) items_no_range.get_patterns ().size (),
Expand Down

0 comments on commit 528c948

Please sign in to comment.