-
-
Notifications
You must be signed in to change notification settings - Fork 15k
use $crate::{self}; should not be accepted #146967
Copy link
Copy link
Closed
Labels
A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)C-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.T-langRelevant to the language teamRelevant to the language team
Metadata
Metadata
Assignees
Labels
A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)C-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.T-langRelevant to the language teamRelevant to the language team
Type
Fields
Give feedbackNo fields configured for issues without a type.
tried this code:
I expected a compile error of some sort. Instead, it compiles fine.
Based on the error message when I try to import it twice, I'm guessing that it's importing the current
cratewith the name$crate.Importing it twice
I am also able to use this import via the name
$crate:Using the import
Surely, this
$crateidentifier should not be able to be used as an actual name?See also #146968 for more nonsense with
$crate.Meta
Reproducible on the playground with version
1.92.0-nightly (2025-09-23 975e6c8fec280816d24f)