原书出处
Write Powerful Rust Macros
04 Making fields public with attribute macros 重建时遇到的信息损失
A much bigger problem is that when we have other macros annotating our struct, they are deleted by ours. Try adding a #[derive(Debug)] below our annotation and running cargo expand. Do you see how the additional annotation vanishes into thin air? We are simply superb at making things disappear. As macros are executed in order, from top to bottom, the simple workaround is adding the derive above our #[public]. Now everything will work as
expected. Except—please do not do this. Instead,
原书定位详情
来源:a19c7933-4eda-4176-aebd-30fe7e1ad292
正文位置:extracted/Write Powerful Rust Macros/_epub-src/OEBPS/Text/chapter-4.xhtml#p73
EPUB SHA-256:68c7ed23324b44144895c3bb55f55731454da237867b66ec66ca6404f5b93661