+
+impl Eq for DefPathData {}
+impl PartialEq for DefPathData {
+ fn eq(&self, other: &DefPathData) -> bool {
+ ::std::mem::discriminant(self) == ::std::mem::discriminant(other) &&
+ self.get_opt_ident() == other.get_opt_ident()
+ }
+}
+
+impl ::std::hash::Hash for DefPathData {
+ fn hash<H: ::std::hash::Hasher>(&self, hasher: &mut H) {
+ ::std::mem::discriminant(self).hash(hasher);
+ if let Some(ident) = self.get_opt_ident() {
+ if ident.ctxt == SyntaxContext::empty() && ident.name == ident.name.interned() {
+ ident.name.as_str().hash(hasher)
+ } else {
+ // FIXME(jseyfried) implement stable hashing for idents with macros 2.0 hygiene info
+ ident.hash(hasher)
+ }
+ }
+ }
+}