diff --git a/src/bytecode.rs b/src/bytecode.rs index 7356972..80d37b0 100644 --- a/src/bytecode.rs +++ b/src/bytecode.rs @@ -1,5 +1,3 @@ -use std::hash::Hash; - use ecow::EcoString; use crate::ty::internal::{Const, Param}; @@ -94,7 +92,7 @@ pub enum OpCode { NoOp, } -#[derive(Debug, Clone, Copy, Hash)] +#[derive(Debug, Clone, Copy)] pub enum BinOp { Add, And, @@ -104,7 +102,7 @@ pub enum BinOp { Upd, } -#[derive(Debug, Clone, Copy, Hash)] +#[derive(Debug, Clone, Copy)] pub enum UnOp { Not, } diff --git a/src/ty/internal/cnst.rs b/src/ty/internal/cnst.rs index af022ed..22f79d3 100644 --- a/src/ty/internal/cnst.rs +++ b/src/ty/internal/cnst.rs @@ -107,16 +107,3 @@ impl PartialEq for Const { } impl Eq for Const {} - -/* impl Hash for Const { - fn hash(&self, state: &mut H) { - use Const::*; - match self { - Bool(b) => b.hash(state), - Int(int) => int.hash(state), - Float(float) => float.to_bits().hash(state), - String(string) => string.hash(state), - Func(func) => func.hash(state), - } - } -} */ diff --git a/src/ty/internal/mod.rs b/src/ty/internal/mod.rs index a8fd615..b27c181 100644 --- a/src/ty/internal/mod.rs +++ b/src/ty/internal/mod.rs @@ -27,7 +27,7 @@ pub trait ToPublic { fn to_public(self, vm: &VM) -> p::Value; } -#[derive(Debug, PartialEq, Eq, Hash, Clone, Copy, Constructor)] +#[derive(Debug, PartialEq, Eq, Clone, Copy, Constructor)] pub struct Thunk(usize); #[derive(Debug, IsVariant, Unwrap, Clone, PartialEq)] diff --git a/src/ty/public/cnst.rs b/src/ty/public/cnst.rs index 4527555..3d4788e 100644 --- a/src/ty/public/cnst.rs +++ b/src/ty/public/cnst.rs @@ -1,5 +1,3 @@ -use std::hash::{Hash, Hasher}; - use anyhow::Error; use derive_more::{IsVariant, Unwrap}; use ecow::EcoString; @@ -121,16 +119,3 @@ impl PartialEq for Const { } impl Eq for Const {} - -impl Hash for Const { - fn hash(&self, state: &mut H) { - use Const::*; - match self { - Bool(b) => b.hash(state), - Int(int) => int.hash(state), - Float(float) => float.to_bits().hash(state), - String(string) => string.hash(state), - func @ Func => func.hash(state), - } - } -}