Skip to content

./x fmt --all is not idempotent #126394

Open
@jieyouxu

Description

@jieyouxu
Member

In the use formatting PR #125443 it was noticed that ./x fmt --all was not idempotent, i.e. ./x fmt --all had to be run twice to reproduce the formatted diff.

(I tried looking for an existing issue for this but couldn't find one.)

Activity

added
T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
C-bugCategory: This is a bug.
on Jun 13, 2024
added
needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.
on Jun 13, 2024
removed
needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.
on Jun 13, 2024
Kobzol

Kobzol commented on Jun 14, 2024

@Kobzol
Contributor

This is not an issue of ./x fmt --all, but of rustfmt. It is not idempotent on this file.

Local repro:

$ ./build/x86_64-unknown-linux-gnu/rustfmt/bin/rustfmt --config-path ${PWD} --edition 2021 --unstable-features --skip-children library/std/src/os/fortanix_sgx/mod.rs
md5sum library/std/src/os/fortanix_sgx/mod.rs
afac84de68b9a8f072adee0b28d1a0d4  library/std/src/os/fortanix_sgx/mod.rs
$ ./build/x86_64-unknown-linux-gnu/rustfmt/bin/rustfmt --config-path ${PWD} --edition 2021 --unstable-features --skip-children library/std/src/os/fortanix_sgx/mod.rs
893f3e29999121b7efb0251662ded8f2  library/std/src/os/fortanix_sgx/mod.rs
Kobzol

Kobzol commented on Jun 14, 2024

@Kobzol
Contributor

Filed an issue in rustfmt: rust-lang/rustfmt#6195.

added and removed
T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
on Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-rustfmtArea: RustfmtC-bugCategory: This is a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @Kobzol@jieyouxu@rustbot

        Issue actions

          `./x fmt --all` is not idempotent · Issue #126394 · rust-lang/rust