Skip to content

Macros are not self-contained #19

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
nyurik opened this issue Apr 16, 2024 · 1 comment
Open

Macros are not self-contained #19

nyurik opened this issue Apr 16, 2024 · 1 comment

Comments

@nyurik
Copy link

nyurik commented Apr 16, 2024

Exported Rust macros (per best "hygiene" practices) should not require any external paths to be brought into local scope. So, if a crate exports a macro, that macro should only use fully-qualified items from the same crate, or more specifically - use the $crate metavariable per docs.

At least declare_stack_allocator_struct! macro uses non-fully-qualified identifiers like declare_stack_allocator_struct! inside, requiring crate users to use it, making the code unclean and possibly error prone.

@danielrh
Copy link
Collaborator

danielrh commented May 9, 2024

Can you put up a PR to do this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants