Re-exporting a trait with a custom derive_macro
@jofas Jonas
·
2026-04-24
·
via The Rust Programming Language Forum - Latest topics
Maybe the foo::Bar macro already implements a way to change the crate name used in the generated code? Like tokio::main does, for example? Then you don't need your own derive macro. If not, most likely (as I understand your description) foo::Bar is a re-export of foo_derive::Bar . These re-exports are often feature-gated. If you provide your own Bar derive macro, I don't see why you should also export foo::Bar . Disabling the feature of foo would resolve the name conflict. [1] If you need the Bar macro internally in your crate, you can still import it directly from foo_derive . ↩︎
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。