aboutsummaryrefslogtreecommitdiff
path: root/syntax/atom.rs
diff options
context:
space:
mode:
authorDavid Tolnay <dtolnay@gmail.com>2020-03-06 10:21:35 -0800
committerDavid Tolnay <dtolnay@gmail.com>2020-03-06 10:21:35 -0800
commit438e26034c8b62dcadb0f83e2ea32cdd7bd05d8f (patch)
treee8cb7a7962707c673dbfcb49267d6e9215b99fb8 /syntax/atom.rs
parentba5eb2de8cbd6fd2b033203b4c3c2d87e8b9f534 (diff)
downloadcxx-438e26034c8b62dcadb0f83e2ea32cdd7bd05d8f.tar.gz
Make PartialEq work with reference lhs
Diffstat (limited to 'syntax/atom.rs')
-rw-r--r--syntax/atom.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/syntax/atom.rs b/syntax/atom.rs
index 903f5610..9fb6554d 100644
--- a/syntax/atom.rs
+++ b/syntax/atom.rs
@@ -54,3 +54,15 @@ impl PartialEq<Atom> for Type {
}
}
}
+
+impl PartialEq<Atom> for &Ident {
+ fn eq(&self, atom: &Atom) -> bool {
+ *self == atom
+ }
+}
+
+impl PartialEq<Atom> for &Type {
+ fn eq(&self, atom: &Atom) -> bool {
+ *self == atom
+ }
+}