Skip to content

Commit b337b2f

Browse files
authored
Add procedural unsafe_gc_impl! macro for manual impls (#22)
All `manually_traced` types use this new macro, making the implementation more concise. Procedural macros are more flexible than what we use currently and single macro for all our manually traced code. This is now a (semi-public) API that downstream crates can start to utilize. Unfortunately, this increases the compile time and dependency tree. The core crate now depends on zerogc-derive and syn (`features=["full"]`). * [derive] Use `crate::` when deriving inside zerogc This is the proc-macro equivelant of '$crate' This allows us to use derive/proc-macros inside of zerogc itself
1 parent 98de026 commit b337b2f

File tree

11 files changed

+1328
-660
lines changed

11 files changed

+1328
-660
lines changed

Cargo.toml

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ readme = "README.md"
1313
# Providing support for these important libraries,
1414
# gives zerogc 'batteries included' support.
1515
indexmap = { version = "1.6", optional = true }
16+
# Used for macros
17+
zerogc-derive = { path = "libs/derive", version = "0.2.0-alpha.1" }
1618

1719
[workspace]
1820
members = ["libs/simple", "libs/derive", "libs/context"]

libs/derive/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ zerogc = { version = "0.2.0-alpha.1", path = "../.." }
1616

1717
[dependencies]
1818
# Proc macros
19-
syn = "1.0.55"
19+
syn = { version = "1.0.55", features = ["full", "extra-traits"] }
2020
quote = "1.0.8"
2121
proc-macro2 = "1"

libs/derive/src/lib.rs

+113-53
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)