-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-decl-macros-2-0Area: Declarative macros 2.0 (#39412)Area: Declarative macros 2.0 (#39412)C-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Description
The original hesitation around these impls was whether to consider things equal that have different Span
s.
I propose that if somebody is writing a macro that relies on knowing whether two tokens are the very same down to their syntax context, we should consider that an unhelpable case of "doing it wrong." On the other hand comparing the text of an Ident is quite common and perfectly correct. For example when iterating through field attributes in a custom derive to handle something like #[serde(rename = "...")]
it makes sense to compare whether the idents in the token stream are == i_serde
or == i_rename
.
tracking issue: #38356
cc @Eijebong @alexcrichton
sffc
Metadata
Metadata
Assignees
Labels
A-decl-macros-2-0Area: Declarative macros 2.0 (#39412)Area: Declarative macros 2.0 (#39412)C-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.