Skip to content

Fix brace placement for multiline control flow - #7005

Open
subotac wants to merge 1 commit into
rust-lang:mainfrom
subotac:fix/multiline-if-let-brace
Open

Fix brace placement for multiline control flow#7005
subotac wants to merge 1 commit into
rust-lang:mainfrom
subotac:fix/multiline-if-let-brace

Conversation

@subotac

@subotac subotac commented Aug 2, 2026

Copy link
Copy Markdown

Summary

Closes #7003.

The multiline-condition brace check included the surrounding assignment offset when comparing indentation. This incorrectly kept the opening brace on the condition's final line.

For Style Edition 2027, compare against the leading indentation of the control-flow expression, matching the Rust Style Guide. Style Edition 2024 behavior remains unchanged.

Tests

Added source/target regression fixtures for Style Editions 2024 and 2027.

@rustbot rustbot added the S-waiting-on-review Status: awaiting review from the assignee but also interested parties. label Aug 2, 2026
@ytmimi ytmimi added the S-on-hold Status: PR/issue is on hold (due to bandwidth/prioritization/need discussions etc.). label Aug 3, 2026
@ytmimi

ytmimi commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Marking this one as on-hold since I'd like to get a second opinion from someone on the style-team about the original issue.

@ytmimi ytmimi removed the S-on-hold Status: PR/issue is on hold (due to bandwidth/prioritization/need discussions etc.). label Aug 3, 2026
@ytmimi

ytmimi commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Got confirmation that this is an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: awaiting review from the assignee but also interested parties.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rustfmt generated unaligned indent code block

3 participants