Skip to content

Fix chain formatting with pre-existing overflow - #7006

Open
subotac wants to merge 1 commit into
rust-lang:mainfrom
subotac:fix/macro-if-long-string-formatting
Open

Fix chain formatting with pre-existing overflow#7006
subotac wants to merge 1 commit into
rust-lang:mainfrom
subotac:fix/macro-if-long-string-formatting

Conversation

@subotac

@subotac subotac commented Aug 2, 2026

Copy link
Copy Markdown

Summary

Closes #6977.

A nested expression rewrite could succeed while the final chain width check rejected the entire result because an unchanged string literal already exceeded max_width.

For Style Edition 2027, allow the chain rewrite to retain the widest pre-existing normal-code line without permitting a wider overflow. 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.

Only succeeds in formatting if there is a comment

2 participants