Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clamp width settings to max_width before warning about exceeding it #6360

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rs-sac
Copy link

@rs-sac rs-sac commented Oct 7, 2024

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:

src/config/config_type.rs Outdated Show resolved Hide resolved
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.  A macro scope now clamps the setting to max_width
before the warning.
@rustbot
Copy link
Collaborator

rustbot commented Oct 25, 2024

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.

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

Successfully merging this pull request may close these issues.

3 participants