rustfmt icon indicating copy to clipboard operation
rustfmt copied to clipboard

Clamp width settings to max_width before warning about exceeding it

Open rs-sac opened this issue 1 year ago • 3 comments

Within a macro scope, max_width is reduced, which can trigger warnings if it is reduced below some other width setting (e.g. struct_lit_width.) Width settings were already being clamped to max_width, but only after the warning fired. The order is now reversed.


This change allows setting, e.g., struct_lit_width to the same value as max_width without getting incorrect warnings within macro scopes. The bug related to macros has been previously acknowledged, and a previous fix was attempted. I attempt to fix the same problem, but my patch takes an approach different from deleting the warning.

Sorry, I failed to check the tests the first time.

Related:

rs-sac avatar Oct 07 '24 17:10 rs-sac

Error: The feature shortcut is not enabled in this repository. To enable it add its section in the triagebot.toml in the root of the repository.

Please file an issue on GitHub at triagebot if there's a problem with this bot, or reach out on #t-infra on Zulip.

rustbot avatar Oct 25 '24 16:10 rustbot

Error: The feature shortcut is not enabled in this repository. To enable it add its section in the triagebot.toml in the root of the repository.

Please file an issue on GitHub at triagebot if there's a problem with this bot, or reach out on #t-infra on Zulip.

rustbot avatar May 08 '25 23:05 rustbot

@ytmimi Sorry to bother you, but is there anything special I need to do to bring this back to your attention for review?

rs-sac avatar May 08 '25 23:05 rs-sac