diff --git a/src/ast.rs b/src/ast.rs index b212278..ed59891 100644 --- a/src/ast.rs +++ b/src/ast.rs @@ -70,12 +70,51 @@ impl PredicateDeclaration pub type PredicateDeclarations = std::collections::BTreeSet>; -#[derive(Eq, Hash, Ord, PartialEq, PartialOrd)] pub struct VariableDeclaration { pub name: String, } +impl std::cmp::PartialEq for VariableDeclaration +{ + #[inline(always)] + fn eq(&self, other: &VariableDeclaration) -> bool + { + let l = self as *const VariableDeclaration; + let r = other as *const VariableDeclaration; + + l.eq(&r) + } +} + +impl std::cmp::Eq for VariableDeclaration +{ +} + +impl std::cmp::PartialOrd for VariableDeclaration +{ + #[inline(always)] + fn partial_cmp(&self, other: &VariableDeclaration) -> Option + { + let l = self as *const VariableDeclaration; + let r = other as *const VariableDeclaration; + + l.partial_cmp(&r) + } +} + +impl std::cmp::Ord for VariableDeclaration +{ + #[inline(always)] + fn cmp(&self, other: &VariableDeclaration) -> std::cmp::Ordering + { + let l = self as *const VariableDeclaration; + let r = other as *const VariableDeclaration; + + l.cmp(&r) + } +} + impl VariableDeclaration { pub fn new(name: String) -> Self