Skip to content

Disagreement between x.py tidy and rustfmt #74274

Closed
@Lucretiel

Description

@Lucretiel

rust/src/libstd/io/buffered.rs

Lines 1136 to 1140 in 9d09331

impl Read for ShortReader {
fn read(&mut self, _: &mut [u8]) -> io::Result<usize> {
if self.lengths.is_empty() { Ok(0) } else { Ok(self.lengths.remove(0)) }
}
}

rustfmt and x.py fmt disagree about the correct formatting of this block. This causes issues with editors configured to "rustfmt-on-save", because you have to keep manually reverting / running tidy. You can see this in the commit log for #72808, which has many commits that unintentionally / accidentally bounce between the two formats:

1bf8ba3
e89e2e4
8df5ae0
f7650fe

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-contributor-roadblockArea: Makes things more difficult for new or seasoned contributors to RustT-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions