fix(tvix/eval): ThunkSet does not need mutable pointers

Change-Id: Iea248870a0ea5d38cb02ff059c968fbd563570b6
Reviewed-on: https://cl.tvl.fyi/c/depot/+/8143
Reviewed-by: raitobezarius <tvl@lahfa.xyz>
Tested-by: BuildkiteCI
This commit is contained in:
Vincent Ambo 2023-02-26 18:25:49 +03:00 committed by tazjin
parent 8c7d5b4f87
commit dccbda5960

View file

@ -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)
}
}