Stream: t-compiler/help

Topic: pub macro vs macro_rules!

yunhua (Dec 05 2019 at 20:55, on Zulip):

Hi there are some macro using pub macro, such as
pub macro Copy($item:item) { /* compiler built-in */ }
what is the difference "pub macro" compare with macro_rules!, there are lots of information for macro_rules!, but I can't find related information for "pub macro", Thanks!

Matthew Jasper (Dec 05 2019 at 21:21, on Zulip): and give a bit of background

Matthew Jasper (Dec 05 2019 at 21:24, on Zulip):

In short the differences are:

Notably a pub macro doesn't end up at the crate root, unlike a #[macro_export] macro_rules!

Last update: Sep 18 2020 at 20:15UTC