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

Hygiene for function-like procedural macros #40356

Closed
antoyo opened this issue Mar 8, 2017 · 2 comments
Closed

Hygiene for function-like procedural macros #40356

antoyo opened this issue Mar 8, 2017 · 2 comments
Assignees
Labels
A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) A-proc-macros Area: Procedural macros C-enhancement Category: An issue proposing an enhancement or a PR with one.

Comments

@antoyo
Copy link
Contributor

antoyo commented Mar 8, 2017

Hello.
I wonder how the hygiene works for function-like procedural macros.
I made a test with these macros that you can find here.

However, it does not compile.
I get the following error:

error[E0425]: cannot find value `vector` in this scope
 --> src/main.rs:9:5
  |
9 |     pp!(vector);
  |     ^^^^^^^^^^^^ not found in this scope

while if the call is:

pp!(vec![1, 2, 3]);

it will compile and works.

Is this an issue with hygiene?

Thanks.

@petrochenkov petrochenkov added A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) A-syntaxext Area: Syntax extensions labels Mar 8, 2017
@abonander
Copy link
Contributor

There is no hygiene support for procedural macros yet. @jseyfried is working on this, though.

@jseyfried jseyfried self-assigned this Mar 9, 2017
@Mark-Simulacrum Mark-Simulacrum added the C-enhancement Category: An issue proposing an enhancement or a PR with one. label Jul 27, 2017
@jyn514 jyn514 added A-proc-macros Area: Procedural macros and removed A-syntaxext Area: Syntax extensions labels Jul 14, 2021
@petrochenkov
Copy link
Contributor

Closing as a duplicate of #54724.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) A-proc-macros Area: Procedural macros C-enhancement Category: An issue proposing an enhancement or a PR with one.
Projects
None yet
Development

No branches or pull requests

6 participants