public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-7698] gccrs: [E0023] Incorrect Number of Fields in Pattern Extraction
@ 2024-01-16 17:54 Arthur Cohen
  0 siblings, 0 replies; only message in thread
From: Arthur Cohen @ 2024-01-16 17:54 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:162aecc7b69d10204be0e92467c58468466d81d5

commit r14-7698-g162aecc7b69d10204be0e92467c58468466d81d5
Author: Muhammad Mahad <mahadtxt@gmail.com>
Date:   Mon Jun 26 15:48:08 2023 +0500

    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 <mahadtxt@gmail.com>

Diff:
---
 gcc/rust/typecheck/rust-hir-type-check-pattern.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/rust/typecheck/rust-hir-type-check-pattern.cc b/gcc/rust/typecheck/rust-hir-type-check-pattern.cc
index bf98ac5a927..474e6c80f8b 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 (),

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-01-16 17:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-16 17:54 [gcc r14-7698] gccrs: [E0023] Incorrect Number of Fields in Pattern Extraction Arthur Cohen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).