https://gcc.gnu.org/g:c8fbbd472c00c7bd5a78b78c8a9873af4a0f08ee

commit c8fbbd472c00c7bd5a78b78c8a9873af4a0f08ee
Author: Pierre-Emmanuel Patry <pierre-emmanuel.pa...@embecosm.com>
Date:   Tue Sep 17 16:15:40 2024 +0200

    Do not assert insertion result
    
    We might have some duplicated name in some pattern and we should
    therefore not assert the non duplication of identifiers.
    
    gcc/rust/ChangeLog:
    
            * resolve/rust-late-name-resolver-2.0.cc (Late::visit): Remove
            assertion and explicitely tells why we ignore the insertion result.
    
    Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.pa...@embecosm.com>

Diff:
---
 gcc/rust/resolve/rust-late-name-resolver-2.0.cc | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gcc/rust/resolve/rust-late-name-resolver-2.0.cc 
b/gcc/rust/resolve/rust-late-name-resolver-2.0.cc
index 16140a232051..addb5bdd6023 100644
--- a/gcc/rust/resolve/rust-late-name-resolver-2.0.cc
+++ b/gcc/rust/resolve/rust-late-name-resolver-2.0.cc
@@ -152,10 +152,10 @@ Late::visit (AST::IdentifierPattern &identifier)
   // do we insert in labels or in values
   // but values does not allow shadowing... since functions cannot shadow
   // do we insert functions in labels as well?
-  auto ok
-    = ctx.values.insert (identifier.get_ident (), identifier.get_node_id ());
 
-  rust_assert (ok);
+  // We do want to ignore duplicated data because some situations rely on it.
+  std::ignore
+    = ctx.values.insert (identifier.get_ident (), identifier.get_node_id ());
 }
 
 void

Reply via email to