diff --git a/canrun/src/collections/lvec/mod.rs b/canrun/src/collections/lvec/mod.rs index e26374f..bd67dc4 100644 --- a/canrun/src/collections/lvec/mod.rs +++ b/canrun/src/collections/lvec/mod.rs @@ -20,7 +20,7 @@ use std::rc::Rc; /// /// Construct with the [`lvec!`](crate::lvec!) macro, or you can use the /// `From>>` or `FromIterator>` trait implementations. -#[derive(Debug)] +#[derive(Debug, Clone)] pub struct LVec { vec: Vec>, } diff --git a/canrun/src/core/value.rs b/canrun/src/core/value.rs index c50eeb0..7a7701b 100644 --- a/canrun/src/core/value.rs +++ b/canrun/src/core/value.rs @@ -23,12 +23,14 @@ debugging purposes as no guarantees are made about the type or generation of the id value. Also, these ids are only valid within the context of a single execution. They cannot be safely persisted or shared between processes. */ -#[derive(Debug, Copy, Eq)] +#[derive(Debug, Copy)] pub struct LVar { pub(crate) id: VarId, t: PhantomData, } +impl Eq for LVar {} + impl PartialEq for LVar { fn eq(&self, other: &LVar) -> bool { self.id == other.id @@ -212,3 +214,12 @@ impl Clone for Value { } } } + +#[cfg(test)] +mod test { + use crate::LVar; + + #[allow(dead_code)] + trait ImplsEq: Eq {} + impl ImplsEq for LVar {} +}