Skip to content
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

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

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.

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

No branches or pull requests

3 participants