Skip to content

Commit

Permalink
Do not assert insertion result
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
P-E-P committed Sep 17, 2024
1 parent b3c6990 commit 81e72db
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions gcc/rust/resolve/rust-late-name-resolver-2.0.cc
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,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
Expand Down

0 comments on commit 81e72db

Please sign in to comment.