From: Pierre-Emmanuel Patry Date: Tue, 17 Sep 2024 14:15:40 +0000 (+0200) Subject: gccrs: Do not assert insertion result X-Git-Tag: basepoints/gcc-16~1144 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=193b66070ef07fe3c734b39faebf7ad2cf28bdee;p=thirdparty%2Fgcc.git gccrs: 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 --- 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 fa759d7bc8b..df67b4f9873 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