Skip to content

Commit 5e3895e

Browse files
stepanchegfacebook-github-bot
authored andcommitted
Remove feature hash_set_entry
Summary: We can live without it. Reviewed By: bobyangyf Differential Revision: D40893481 fbshipit-source-id: 0e48ba2c567c39eb5ba3b31abb4e7a8d2fa33c88
1 parent 07a79f9 commit 5e3895e

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

starlark/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,6 @@
359359
#![feature(const_type_id)]
360360
#![feature(core_intrinsics)]
361361
#![feature(generic_associated_types)]
362-
#![feature(hash_set_entry)]
363362
#![feature(maybe_uninit_slice)]
364363
#![feature(maybe_uninit_write_slice)]
365364
#![feature(ptr_metadata)]

starlark/src/values/layout/heap/heap_type.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,10 @@ impl FrozenHeap {
237237
/// is kept alive. Used if a [`FrozenValue`] in this heap points at values in another
238238
/// [`FrozenHeap`].
239239
pub fn add_reference(&self, heap: &FrozenHeapRef) {
240-
self.refs.borrow_mut().get_or_insert_owned(heap);
240+
let mut refs = self.refs.borrow_mut();
241+
if !refs.contains(heap) {
242+
refs.insert(heap.dupe());
243+
}
241244
}
242245

243246
fn alloc_raw(&self, x: impl AValue<'static, ExtraElem = ()> + Send + Sync) -> FrozenValue {

0 commit comments

Comments
 (0)