Skip to content

Is the order of proc-macro expansion defined? #578

New issue

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

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

Already on GitHub? # to your account

Open
ehuss opened this issue Apr 21, 2019 · 2 comments
Open

Is the order of proc-macro expansion defined? #578

ehuss opened this issue Apr 21, 2019 · 2 comments
Labels
A-macros Area: Macros

Comments

@ehuss
Copy link
Contributor

ehuss commented Apr 21, 2019

Or is it intentionally left undefined (if so, that should be specified)? Proc-macros can have side-effects. If it is defined, what its it? (In source-sequence, starting from crate root, entire module processed before mod statements, or are mod processed as seen?)

@ehuss ehuss added the A-macros Area: Macros label Apr 21, 2019
@Centril
Copy link
Contributor

Centril commented Apr 21, 2019

The order is as afar as I know undefined.

cc @eddyb

@eddyb
Copy link
Member

eddyb commented Apr 22, 2019

It's very much the opposite of defined (well, not UB, but implementation-specific non-deterministic).
This is (in part) so we can have some hope of incremental re-expansion, even with impure macros.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-macros Area: Macros
Projects
None yet
Development

No branches or pull requests

3 participants