From dccbda596067a7650eeeec96433b715909ba43b8 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 26 Feb 2023 18:25:49 +0300 Subject: fix(tvix/eval): ThunkSet does not need mutable pointers Change-Id: Iea248870a0ea5d38cb02ff059c968fbd563570b6 Reviewed-on: https://cl.tvl.fyi/c/depot/+/8143 Reviewed-by: raitobezarius Tested-by: BuildkiteCI --- tvix/eval/src/value/thunk.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tvix/eval/src/value/thunk.rs b/tvix/eval/src/value/thunk.rs index 560e33244da3..1be3370b2377 100644 --- a/tvix/eval/src/value/thunk.rs +++ b/tvix/eval/src/value/thunk.rs @@ -478,13 +478,13 @@ impl Serialize for Thunk { /// The inner `HashSet` is not available on the outside, as it would be /// potentially unsafe to interact with the pointers in the set. #[derive(Default)] -pub struct ThunkSet(HashSet<*mut ThunkRepr>); +pub struct ThunkSet(HashSet<*const ThunkRepr>); impl ThunkSet { /// Check whether the given thunk has already been seen. Will mark the thunk /// as seen otherwise. pub fn insert(&mut self, thunk: &Thunk) -> bool { - let ptr: *mut ThunkRepr = thunk.0.as_ptr(); + let ptr: *const ThunkRepr = thunk.0.as_ptr(); self.0.insert(ptr) } } -- cgit 1.4.1