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.tomldiffbeforeafterboth1[package]2name = "jrsonnet-types"3description = "Jrsonnet type system definition"4version = "0.3.7"5authors = ["Yaroslav Bolyukin <iam@lach.pw>"]6license = "MIT"7edition = "2018"89[dependencies]10peg = "0.7.0"1[package]2name = "jrsonnet-types"3description = "Jrsonnet type system definition"4version = "0.3.7"5authors = ["Yaroslav Bolyukin <iam@lach.pw>"]6license = "MIT"7edition = "2018"89[dependencies]10peg = "0.7.0"11gc = { version = "0.4.1", features = ["derive"] }crates/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)