Skip to content

fix(fmt): don't inline while/for/if blocks with multiple statements#13566

Merged
onbjerg merged 1 commit intofoundry-rs:masterfrom
MarkFizz77:fix/fmt-multi-stmt-while-inline
Mar 2, 2026
Merged

fix(fmt): don't inline while/for/if blocks with multiple statements#13566
onbjerg merged 1 commit intofoundry-rs:masterfrom
MarkFizz77:fix/fmt-multi-stmt-while-inline

Conversation

@MarkFizz77
Copy link
Contributor

Fixes #13555

forge fmt silently drops statements from single-line blocks with multiple statements (e.g. while (x) { a++; b++; }) by only keeping the first inside the loop, changing program semantics without warning.

Copy link
Member

@onbjerg onbjerg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@onbjerg onbjerg merged commit 226c0fd into foundry-rs:master Mar 2, 2026
16 checks passed
@github-project-automation github-project-automation bot moved this to Done in Foundry Mar 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

forge fmt silently drops statements from single-line while loop bodies with multiple statements

2 participants