[COMMITTED 32/42] gccrs: Add equality operator for identifiers
arthur.cohen@embecosm.com
arthur.cohen@embecosm.com
Mon Apr 28 14:43:56 GMT 2025
From: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
gcc/rust/ChangeLog:
* ast/rust-ast.h: Add equality operator.
Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
---
gcc/rust/ast/rust-ast.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/gcc/rust/ast/rust-ast.h b/gcc/rust/ast/rust-ast.h
index 55f178d782c..94585dc1344 100644
--- a/gcc/rust/ast/rust-ast.h
+++ b/gcc/rust/ast/rust-ast.h
@@ -57,6 +57,11 @@ public:
bool empty () const { return ident.empty (); }
+ bool operator== (const Identifier &other) const
+ {
+ return ident == other.ident;
+ }
+
private:
std::string ident;
location_t loc;
--
2.49.0
More information about the Gcc-rust
mailing list