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

Use #[rustfmt::skip] on some use groups to prevent reordering. #127950

Merged
merged 1 commit into from
Jul 26, 2024

Commits on Jul 19, 2024

  1. Use #[rustfmt::skip] on some use groups to prevent reordering.

    `use` declarations will be reformatted in rust-lang#125443. Very rarely, there is
    a desire to force a group of `use` declarations together in a way that
    auto-formatting will break up. E.g. when you want a single comment to
    apply to a group. rust-lang#126776 dealt with all of these in the codebase,
    ensuring that no comments intended for multiple `use` declarations would
    end up in the wrong place. But some people were unhappy with it.
    
    This commit uses `#[rustfmt::skip]` to create these custom `use` groups
    in an idiomatic way for a few of the cases changed in rust-lang#126776. This
    works because rustfmt treats any `use` item annotated with
    `#[rustfmt::skip]` as a barrier and won't reorder other `use` items
    around it.
    nnethercote committed Jul 19, 2024
    Configuration menu
    Copy the full SHA
    c5dadd0 View commit details
    Browse the repository at this point in the history