-
Notifications
You must be signed in to change notification settings - Fork 1k
rustfmt breaks macro code #6629
Copy link
Copy link
Labels
A-macrosArea: macros (procedural macros, macro_rules! macros, etc.)Area: macros (procedural macros, macro_rules! macros, etc.)C-bugCategory: this is a bug; use also I-* labels for specific bug kinds, e.g. I-non-idempotency or I-ICECategory: this is a bug; use also I-* labels for specific bug kinds, e.g. I-non-idempotency or I-ICEI-invalid-codeIssue: formatting causes compile-pass code to compile-failIssue: formatting causes compile-pass code to compile-fail
Metadata
Metadata
Assignees
Labels
A-macrosArea: macros (procedural macros, macro_rules! macros, etc.)Area: macros (procedural macros, macro_rules! macros, etc.)C-bugCategory: this is a bug; use also I-* labels for specific bug kinds, e.g. I-non-idempotency or I-ICECategory: this is a bug; use also I-* labels for specific bug kinds, e.g. I-non-idempotency or I-ICEI-invalid-codeIssue: formatting causes compile-pass code to compile-failIssue: formatting causes compile-pass code to compile-fail
Type
Fields
Give feedbackNo fields configured for Bug.
I tried this code:
The source is available at Rust Playground. It compiles and runs well.
I will run
rustfmtfor this using latest nightly Rust.I expected to see this happen: The code is correctly formatted.
Instead, this happened: It formats to:
The resulted code won't compile.
Meta
rustc --version --verbose:Backtrace