-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Pretty-printing/tokenization of final has changed to r#final #62628
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, ..)A-parserArea: The lexing & parsing of Rust source code to an ASTArea: The lexing & parsing of Rust source code to an ASTC-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.
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, ..)A-parserArea: The lexing & parsing of Rust source code to an ASTArea: The lexing & parsing of Rust source code to an ASTC-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.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Given a procedural macro like:
and a consumer like:
This previously compiled and succeeded on nightly-2019-07-10 but fails on nightly-2017-07-11. Bisection yields #62555 as the culprit of which #62393 is the likely true culprit.
When running if you set
RUSTC_LOG=syntaxyou get:which I believe means that the compiler is pretty-printing the identifier in macros as
r#finalinstead offinal.For reference this is a pretty minimized scenario but it has broken
wasm-bindgen's test suite (which uses#[wasm_bindgen(final)]throughout). @petrochenkov is this intentional? Is this something that should be fixed or "the macro parser needs to be update"?(I'm gonna update the parser anyway but wanted to be sure to file an issue as well)