From 9b8359fa9e9b1d27d719f5334a6f44b48adfe7a7 Mon Sep 17 00:00:00 2001 From: Brad Werth Date: Thu, 20 May 2021 17:26:22 +0000 Subject: [PATCH] Bug 1706561 Part 3: Make intern Handles hashable. r=gw This is needed to support the use of intern::Handle structs in hashable enums. Differential Revision: https://phabricator.services.mozilla.com/D114556 --- gfx/wr/webrender/src/intern.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gfx/wr/webrender/src/intern.rs b/gfx/wr/webrender/src/intern.rs index 5dd9c90600b5..499036cba624 100644 --- a/gfx/wr/webrender/src/intern.rs +++ b/gfx/wr/webrender/src/intern.rs @@ -44,7 +44,7 @@ use crate::profiler::TransactionProfile; #[cfg_attr(feature = "capture", derive(Serialize))] #[cfg_attr(feature = "replay", derive(Deserialize))] -#[derive(Debug, Copy, Clone, MallocSizeOf, PartialEq)] +#[derive(Debug, Copy, Clone, Hash, MallocSizeOf, PartialEq, Eq)] struct Epoch(u32); /// A list of updates to be applied to the data store, @@ -110,7 +110,7 @@ impl ItemUid { #[cfg_attr(feature = "capture", derive(Serialize))] #[cfg_attr(feature = "replay", derive(Deserialize))] -#[derive(Debug, MallocSizeOf, PartialEq)] +#[derive(Debug, Hash, MallocSizeOf, PartialEq, Eq)] pub struct Handle { index: u32, epoch: Epoch, -- 2.11.4.GIT