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
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

2 participants