From: Muhammad Mahad Date: Mon, 26 Jun 2023 10:48:08 +0000 (+0500) Subject: gccrs: [E0023] Incorrect Number of Fields in Pattern Extraction X-Git-Tag: basepoints/gcc-15~2441 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=162aecc7b69d10204be0e92467c58468466d81d5;p=thirdparty%2Fgcc.git 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 --- diff --git a/gcc/rust/typecheck/rust-hir-type-check-pattern.cc b/gcc/rust/typecheck/rust-hir-type-check-pattern.cc index bf98ac5a9279..474e6c80f8b7 100644 --- a/gcc/rust/typecheck/rust-hir-type-check-pattern.cc +++ b/gcc/rust/typecheck/rust-hir-type-check-pattern.cc @@ -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 (),