diff options
Diffstat (limited to 'src/eval')
| -rw-r--r-- | src/eval/show.rs | 25 |
1 files changed, 2 insertions, 23 deletions
diff --git a/src/eval/show.rs b/src/eval/show.rs index a6a48e6f..ac0e2378 100644 --- a/src/eval/show.rs +++ b/src/eval/show.rs @@ -1,6 +1,6 @@ use std::any::{Any, TypeId}; use std::fmt::{self, Debug, Formatter}; -use std::hash::{Hash, Hasher}; +use std::hash::Hash; use std::sync::Arc; use super::{StyleChain, Template}; @@ -59,18 +59,12 @@ impl Debug for ShowNode { impl PartialEq for ShowNode { fn eq(&self, other: &Self) -> bool { - // We cast to thin pointers for comparison because we don't want to - // compare vtables (which can be different across codegen units). - std::ptr::eq( - Arc::as_ptr(&self.0) as *const (), - Arc::as_ptr(&other.0) as *const (), - ) + self.0.eq(&other.0) } } trait Bounds: Show + Debug + Sync + Send + 'static { fn as_any(&self) -> &dyn Any; - fn hash64(&self) -> u64; } impl<T> Bounds for T @@ -80,19 +74,4 @@ where fn as_any(&self) -> &dyn Any { self } - - fn hash64(&self) -> u64 { - // Also hash the TypeId since nodes with different types but - // equal data should be different. - let mut state = fxhash::FxHasher64::default(); - self.type_id().hash(&mut state); - self.hash(&mut state); - state.finish() - } -} - -impl Hash for dyn Bounds { - fn hash<H: Hasher>(&self, state: &mut H) { - state.write_u64(self.hash64()); - } } |
