difftreelog
feat(jrsonnet-interner) implement gc
in: master
Interned string is backed by Rc<str>, there is nothing to trace here
2 files changed
crates/jrsonnet-interner/Cargo.tomldiffbeforeafterboth1[package]2name = "jrsonnet-interner"3description = "Jrsonnet string interning"4version = "0.3.7"5authors = ["Yaroslav Bolyukin <iam@lach.pw>"]6license = "MIT"7edition = "2018"89[dependencies]10serde = { version = "1.0" }11rustc-hash = "1.1.0"1[package]2name = "jrsonnet-interner"3description = "Jrsonnet string interning"4version = "0.3.7"5authors = ["Yaroslav Bolyukin <iam@lach.pw>"]6license = "MIT"7edition = "2018"89[dependencies]10serde = { version = "1.0" }11rustc-hash = "1.1.0"12gc = { version = "0.4.1", features = ["derive"] }crates/jrsonnet-interner/src/lib.rsdiffbeforeafterboth--- a/crates/jrsonnet-interner/src/lib.rs
+++ b/crates/jrsonnet-interner/src/lib.rs
@@ -1,3 +1,4 @@
+use gc::{unsafe_empty_trace, Finalize, Trace};
use rustc_hash::FxHashMap;
use serde::{Deserialize, Serialize};
use std::{
@@ -10,6 +11,10 @@
#[derive(Clone, PartialOrd, Ord, Eq)]
pub struct IStr(Rc<str>);
+impl Finalize for IStr {}
+unsafe impl Trace for IStr {
+ unsafe_empty_trace!();
+}
impl Deref for IStr {
type Target = str;