Tracking issue for rust-lang/rfcs#1681.
cc @alexcrichton
Stabilization TODO
Litmus tests:
Features:
- Crate name, currently is
proc_macro
- Crate type, currently
proc-macro
- The
#[proc_macro_derive(Foo)] attribute
- Loading
proc-macro crates with -L and #[macro_use] to load them
- shadowing is an error
- no hygiene
- passing a token stream for the entire struct and receiving it all back
- Cargo manifest attribute, currently
proc-macro = true
Known bugs:
Implementation TODO
Tracking issue for rust-lang/rfcs#1681.
cc @alexcrichton
Stabilization TODO
Litmus tests:
Features:
proc_macroproc-macro#[proc_macro_derive(Foo)]attributeproc-macrocrates with-Land#[macro_use]to load themproc-macro = trueKnown bugs:
mod foofail - Custom derives: TokenStream::from_str fails if the string contains 'mod foo;' #36691proc_macro- Publish docs forproc_macrocrate #38749#[derive]s after other attribute macros and improve intra-#[derive]ordering #37067)Implementation TODO
rustc_macrocratelibrustc_macrolink tolibsyntax. Depend onlibrustc_macroinlibrustc_driverrustc_macroas unstable with our standard header.rustc_macrowith#![crate_type = "rlib"], do not produce a dylib.rustc_macrousinglibsyntax'sTokenStreaminternallyrustc_macrowith aTokenStreamlang item so the compiler knows about it.rustc_macro_deriveattributefoo(bar), no other arguments/formatsTokenStreamlang item added aboverustc_macro_deriveinto metadata along with the derive mode they're used for.rustc-macrocrate type for other cratesrustc-macrocrates cannot be linked as dylibs#[rustc_macro_derive]cfg(rustc_macro)as an unstablecfgdirective, set it for therustc-macrocrate typerustc-macrocrates link dynamically to libsytnax#[macro_use]support forrustc-macrocratesrustc-macrocrates separately from dylib/rlib tracked today when loding cratesrustc-macrocrates to learn about symbol/derive mode pairingsdlopenthe dylibrustc-macrosimilar toplugin = true--crate-type=rustc-macrowhen depending on it#[derive]trait