]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Do not assert insertion result
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Tue, 17 Sep 2024 14:15:40 +0000 (16:15 +0200)
committerP-E-P <32375388+P-E-P@users.noreply.github.com>
Thu, 26 Sep 2024 22:48:32 +0000 (22:48 +0000)
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.patry@embecosm.com>
gcc/rust/resolve/rust-late-name-resolver-2.0.cc

index 16140a23205142b068eef998248e41ebdac3a764..addb5bdd60238a8de1b6cd1424db7573eea0c22d 100644 (file)
@@ -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