Releases: sam0x17/macro_magic
v0.5.1
v0.5.0
v0.4.3
v0.4.2
Adds a stronger uniqueness guarantee to new_unique_export_tokens_ident
by incorporating a compilation-unique tag.
This will resolve situations where crates using separate instances of macro_magic that happen to have #[export_tokens]
declarations that use the same name and happen to have the same COUNTER
value are glob imported into the same module/scope.
Though these scenarios are already exceedingly rare, after this change for this to happen again two separate macro_magic compilations would also have to have their COMPILATION_TAG: u32
value collide, which is as unlikely as two random u32
values colliding, in addition to all of the other collision requirements laid out above. So this shouldn't be an issue anymore for anyone. If it does happen, you can rest assured it will go away after a fresh compile unless the universe truly despises you.
v0.4.1
v0.4.0
This release contains breaking changes.
Deprecations/Removals:
#[use_attr]
has been removed#[use_proc]
has been removedpretty_print
feature has been removed. For a better alternative see my proc-utils crate.- Ability to access
#[export_tokens]
that would normally be inaccessible due to private modules or inaccessible path has been removed
New Features
#[import_tokens_proc]
and#[import_tokens_attr]
now no longer need#[use_attr]
and#[use_proc]
to be brought into scope properly or re-exported, thanks to a new self-calling macro structure.- The
MACRO_MAGIC_ROOT
/mm_override_path
can now also be overridden on#[import_tokens_proc]
and#[import_tokens_attr]
by passing a path or an expr (the expr option is new). The expr must evaluate to something compatible withInto<String>
and must contain a valid path to amacro_magic
re-export. - New expansion strategy for
#[export_tokens]
which allows for multiple items with the same name in the same crate (but not at the same path) and enables streamlined importing and re-exporting of macros created viamacro_magic
, - Improved docs for internal items in the core crate
- Improved docs for custom parsing
- Additional doc examples