-
Notifications
You must be signed in to change notification settings - Fork 985
Open
rust-lang/rust
#152234Labels
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-failP-highHigh priorityHigh priorityS-has-bisectionStatus: a bisection has been found for this issueStatus: a bisection has been found for this issueS-has-mcveStatus: a Minimal Complete and Verifiable Example has been found for this issueStatus: a Minimal Complete and Verifiable Example has been found for this issueregression-from-stable-to-betaRegression from stable to beta.Regression from stable to beta.
Description
Given the following code:
fn foo() {
let a = [(); const { let x = 1; x }];
}On version 1.94.0-beta.2 (2026-01-25 23a44d3c70448c08dc6a), rustfmt will format this code into the following code, which is broken:
fn foo() {
let a = [(); { onst { let x = 1;
x
}];
}On version 1.93.0, however, rustfmt correctly formats the code as follows:
fn foo() {
let a = [(); const {
let x = 1;
x
}];
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
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-failP-highHigh priorityHigh priorityS-has-bisectionStatus: a bisection has been found for this issueStatus: a bisection has been found for this issueS-has-mcveStatus: a Minimal Complete and Verifiable Example has been found for this issueStatus: a Minimal Complete and Verifiable Example has been found for this issueregression-from-stable-to-betaRegression from stable to beta.Regression from stable to beta.