[Solved] Compiler information from custom attribute handler (proc macro)?

You could write a compiler plugin, which is more powerful than macros. I've never done this because there are no guarantees about stability of internal compiler API and there probably never will be -> This is actually the reason for stabilizing procedural macros as is.
There is one example that i know of: GitHub - SkylerLipthay/interpolate_idents: Useable macro identifier concatenation plugin for Rust (deprecated)

I understand the need for delegation. There is currently no way, other than having compiler context, to retrieve the necessary information.

Related to this topic, a crate passed by a few weeks earlier which (partly) solved delegation utilizing associated methods: Delegate: method delegation with less boilerplate.
There is also remote derive implemented in Serde, which could be of interest.

1 Like