difftreelog
feat(jrsonnet-types) implement gc
in: master
It is currently not possible to implement recursive type, so all tracing is noop here
2 files changed
crates/jrsonnet-types/Cargo.tomldiffbeforeafterboth889[dependencies]9[dependencies]10peg = "0.7.0"10peg = "0.7.0"11gc = { version = "0.4.1", features = ["derive"] }1112crates/jrsonnet-types/src/lib.rsdiffbeforeafterboth--- a/crates/jrsonnet-types/src/lib.rs
+++ b/crates/jrsonnet-types/src/lib.rs
@@ -1,5 +1,6 @@
#![allow(clippy::redundant_closure_call)]
+use gc::{unsafe_empty_trace, Finalize, Trace};
use std::fmt::Display;
#[macro_export]
@@ -87,6 +88,10 @@
Obj,
Func,
}
+impl Finalize for ValType {}
+unsafe impl Trace for ValType {
+ unsafe_empty_trace!();
+}
impl ValType {
pub const fn name(&self) -> &'static str {
@@ -123,6 +128,11 @@
Sum(Vec<ComplexValType>),
SumRef(&'static [ComplexValType]),
}
+impl Finalize for ComplexValType {}
+unsafe impl Trace for ComplexValType {
+ unsafe_empty_trace!();
+}
+
impl From<ValType> for ComplexValType {
fn from(s: ValType) -> Self {
Self::Simple(s)