I wrote my first custom derive macro

See:

for a description of the frontend (with traits, re-exporting proc-macro, …) + backend (proc-macro only) crates pattern.

If the frontend crate (say, heapsize, or space_age) happens to call the proc-macro itself, you can put extern crate self as space_age; at the root of its lib.rs to allow referring to your own crate as if it were an external one, making the proc-macro thus usable internally :slightly_smiling_face:

1 Like