Skip to content

Commit

Permalink
gccrs: [E0027] struct pattern fails to specify struct's fields
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
MahadMuhammad authored and philberty committed Jun 30, 2023
1 parent ec0c3ad commit 251348f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gcc/rust/typecheck/rust-hir-type-check-pattern.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 ());
}
}
Expand Down

0 comments on commit 251348f

Please sign in to comment.