From 33b7cd39719fbe4ca643e756220bd1e3d8473ebf Mon Sep 17 00:00:00 2001 From: John Date: Thu, 16 May 2024 15:04:37 -0500 Subject: [PATCH] cl-structures: Do not #[derive(Eq)] for Interned Derive places Eq bound on T, which is not true of Interned --- compiler/cl-structures/src/intern.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/cl-structures/src/intern.rs b/compiler/cl-structures/src/intern.rs index 31370a2..e52e6d1 100644 --- a/compiler/cl-structures/src/intern.rs +++ b/compiler/cl-structures/src/intern.rs @@ -26,7 +26,6 @@ pub mod interned { /// dereference to the wrapped pointers, and as such, may produce /// results inconsistent with [PartialEq] or [Eq]. #[repr(transparent)] - #[derive(Eq)] pub struct Interned<'a, T: ?Sized> { value: &'a T, } @@ -80,6 +79,7 @@ pub mod interned { // } // } + impl<'a, T: ?Sized> Eq for Interned<'a, T> {} impl<'a, T: ?Sized> PartialEq for Interned<'a, T> { fn eq(&self, other: &Self) -> bool { std::ptr::eq(self.value, other.value)