Skip to content

Hygiene for function-like procedural macros #40356

Closed
@antoyo

Description

@antoyo

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.

Metadata

Metadata

Assignees

Labels

A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)A-proc-macrosArea: Procedural macrosC-enhancementCategory: An issue proposing an enhancement or a PR with one.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions