Rust Macros

Write a macro only when a function, a trait, or a generic cannot do the job — then by-example before proc-macro, with hygiene, a `_private` helper module, and spanned compile errors instead of panics. Use when writing or reviewing macro_rules! or a proc macro, when a derive or attribute macro is being added, when macro hygiene or `$crate` comes up, or when the user asks whether something should be a macro.

rewrite-rs c2cb95f 2 files · 4.9 KB Updated

File contents

rewrite-rs/skills/tree/main/skills/misc/rust-macros commit c2cb95f329

Frequently asked questions

npx skillmds@latest add rewrite-rs/rust-macros