public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-7697] gccrs: gccrs:[E0026] Non-Existent Field Extraction in Struct Pattern
@ 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:69a64dcb20e0da87c849a27148e1599a6f4d72e8

commit r14-7697-g69a64dcb20e0da87c849a27148e1599a6f4d72e8
Author: Muhammad Mahad <mahadtxt@gmail.com>
Date:   Tue Jun 20 20:19:13 2023 +0500

    gccrs: gccrs:[E0026] Non-Existent Field Extraction in Struct Pattern
    
    Non-Existent Field Extraction in Struct Pattern
    variant `Foo::D` does not have a field named `b`
    
    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 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/rust/typecheck/rust-hir-type-check-pattern.cc b/gcc/rust/typecheck/rust-hir-type-check-pattern.cc
index b5a115f5945..bf98ac5a927 100644
--- a/gcc/rust/typecheck/rust-hir-type-check-pattern.cc
+++ b/gcc/rust/typecheck/rust-hir-type-check-pattern.cc
@@ -204,7 +204,7 @@ TypeCheckPattern::visit (HIR::StructPattern &pattern)
 	    if (!variant->lookup_field (ident.get_identifier (), &field,
 					nullptr))
 	      {
-		rust_error_at (ident.get_locus (),
+		rust_error_at (ident.get_locus (), ErrorCode ("E0026"),
 			       "variant %s does not have a field named %s",
 			       variant->get_identifier ().c_str (),
 			       ident.get_identifier ().c_str ());
@@ -225,7 +225,7 @@ TypeCheckPattern::visit (HIR::StructPattern &pattern)
 	    if (!variant->lookup_field (ident.get_identifier (), &field,
 					nullptr))
 	      {
-		rust_error_at (ident.get_locus (),
+		rust_error_at (ident.get_locus (), ErrorCode ("E0026"),
 			       "variant %s does not have a field named %s",
 			       variant->get_identifier ().c_str (),
 			       ident.get_identifier ().c_str ());

^ 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-7697] gccrs: gccrs:[E0026] Non-Existent Field Extraction in Struct Pattern 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).