-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-decl-macros-2-0Area: Declarative macros 2.0 (#39412)Area: Declarative macros 2.0 (#39412)A-hygieneArea: Macro hygieneArea: Macro hygieneA-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)A-proc-macrosArea: Procedural macrosArea: Procedural macrosC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
Hi.
I'm not sure whether it is a bug or not, that may be an hygiene issue.
But, in the following repository, if you run it with cargo build
, you get the following error:
error[E0451]: field `my_field` of struct `MyStruct` is private
--> src/main.rs:12:5
|
12 | pp!(MyStruct);
| ^^^^^^^^^^^^^^ field `my_field` is private
However, that does not make sense, because the field is declared in the same module:
struct MyStruct {
my_field: i32,
}
fn main() {
pp!(MyStruct); // Error: field `my_field` of struct `MyStruct` is private.
}
This only happens when this feature is enabled.
What makes me think this might be an hygiene issue is that I hard-coded the field name here.
So, if it's a bug, please fix this issue.
Thank you.
Metadata
Metadata
Assignees
Labels
A-decl-macros-2-0Area: Declarative macros 2.0 (#39412)Area: Declarative macros 2.0 (#39412)A-hygieneArea: Macro hygieneArea: Macro hygieneA-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)A-proc-macrosArea: Procedural macrosArea: Procedural macrosC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.