-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Format libcore with rustfmt #66691
Format libcore with rustfmt #66691
Conversation
r? @sfackler (rust_highfive has picked a reviewer for you, use r? to override) |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
I need to update #[unstable(
feature = "derive_clone_copy", |
"Default" here means https://github.com/rust-lang/rust/blob/master/rustfmt.toml or really default? |
cc #65939 |
Ah, it's with that rustfmt.toml. It got picked up from running rustfmt in the same directory. |
r=me |
☔ The latest upstream changes (presumably #66739) made this pull request unmergeable. Please resolve the merge conflicts. |
Rebased on #66717, removing from this PR 2 files that have been touched since first opening this PR (so that there is nothing new to review):
and 6 files that appear in newly opened PRs:
|
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
This commit applies rustfmt with default settings to files in src/libcore *that are not involved in any currently open PR* to minimize merge conflicts. The list of files involved in open PRs was determined by querying GitHub's GraphQL API with this script: https://gist.github.com/dtolnay/aa9c34993dc051a4f344d1b10e4487e8 With the list of files from the script in `outstanding_files`, the relevant commands were: $ find src/libcore -name '*.rs' | xargs rustfmt --edition=2018 $ rg libcore outstanding_files | xargs git checkout -- Repeating this process several months apart should get us coverage of most of the rest of libcore.
|
@bors r=sfackler |
📌 Commit 166471e has been approved by |
Format libcore with rustfmt I am interested in whether we can begin cautious incremental progress on #66688 and assess along the way whether we can keep the disruption sufficiently small. This PR applies rustfmt with default settings to files in src/libcore *that are not involved in any currently open PR* to minimize merge conflicts. The list of files involved in open PRs was determined by querying GitHub's GraphQL API [with this script](https://gist.github.com/dtolnay/aa9c34993dc051a4f344d1b10e4487e8). With the list of files from the script in `outstanding_files`, the relevant commands were: ```console $ find src/libcore -name '*.rs' | xargs rustfmt --edition=2018 $ rg libcore outstanding_files | xargs git checkout -- ``` Repeating this process several months apart should get us coverage of most of the rest of libcore.
☀️ Test successful - checks-azure |
const TAG_CONT: u8 = 0b1000_0000; | ||
const TAG_TWO_B: u8 = 0b1100_0000; | ||
const TAG_THREE_B: u8 = 0b1110_0000; | ||
const TAG_FOUR_B: u8 = 0b1111_0000; | ||
const MAX_ONE_B: u32 = 0x80; | ||
const MAX_TWO_B: u32 = 0x800; | ||
const MAX_THREE_B: u32 = 0x10000; | ||
const TAG_CONT: u8 = 0b1000_0000; | ||
const TAG_TWO_B: u8 = 0b1100_0000; | ||
const TAG_THREE_B: u8 = 0b1110_0000; | ||
const TAG_FOUR_B: u8 = 0b1111_0000; | ||
const MAX_ONE_B: u32 = 0x80; | ||
const MAX_TWO_B: u32 = 0x800; | ||
const MAX_THREE_B: u32 = 0x10000; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a way to register exceptions from rustfmt? The manual alignment here, at least for the first tags that are written in binary, was quite useful IMO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is, but I don't think the alignment is enough of a readability improvement to be worth making an exception here. I think the underscore grouping is sufficient to read them clearly. I am amenable in general to making rustfmt exceptions but I think it doesn't make enough of a difference in this case.
Format libstd with rustfmt (Same strategy as #66691.) This commit applies rustfmt with rust-lang/rust's default settings to files in src/libstd *that are not involved in any currently open PR* to minimize merge conflicts, and are not part of libstd/os (#66818) or libstd/sys (#66819). The list of files involved in open PRs was determined by querying GitHub's GraphQL API [with this script](https://gist.github.com/dtolnay/aa9c34993dc051a4f344d1b10e4487e8). With the list of files from the script in outstanding_files, the relevant commands were: $ find src/libstd -name '*.rs' \ | xargs rustfmt --edition=2018 --unstable-features --skip-children $ rg libstd outstanding_files | xargs git checkout -- Repeating this process several months apart should get us coverage of most of the rest of libstd. To confirm no funny business: $ git checkout $THIS_COMMIT^ $ git show --pretty= --name-only $THIS_COMMIT \ | xargs rustfmt --edition=2018 --unstable-features --skip-children $ git diff $THIS_COMMIT # there should be no difference
Format libstd/os with rustfmt (Same strategy as rust-lang#66691.) This commit applies rustfmt with rust-lang/rust's default settings to files in src/libstd/os *that are not involved in any currently open PR* to minimize merge conflicts. The list of files involved in open PRs was determined by querying GitHub's GraphQL API [with this script](https://gist.github.com/dtolnay/aa9c34993dc051a4f344d1b10e4487e8). With the list of files from the script in outstanding_files, the relevant commands were: $ find src/libstd/os -name '*.rs' \ | xargs rustfmt --edition=2018 --unstable-features --skip-children $ rg libstd/os outstanding_files | xargs git checkout -- Repeating this process several months apart should get us coverage of most of the rest of the files. To confirm no funny business: $ git checkout $THIS_COMMIT^ $ git show --pretty= --name-only $THIS_COMMIT \ | xargs rustfmt --edition=2018 --unstable-features --skip-children $ git diff $THIS_COMMIT # there should be no difference
Format libstd/sys with rustfmt (Same strategy as rust-lang#66691.) This commit applies rustfmt with rust-lang/rust's default settings to files in src/libstd/sys *that are not involved in any currently open PR* to minimize merge conflicts. The list of files involved in open PRs was determined by querying GitHub's GraphQL API [with this script](https://gist.github.com/dtolnay/aa9c34993dc051a4f344d1b10e4487e8). With the list of files from the script in outstanding_files, the relevant commands were: $ find src/libstd/sys -name '*.rs' \ | xargs rustfmt --edition=2018 --unstable-features --skip-children $ rg libstd/sys outstanding_files | xargs git checkout -- Repeating this process several months apart should get us coverage of most of the rest of the files. To confirm no funny business: $ git checkout $THIS_COMMIT^ $ git show --pretty= --name-only $THIS_COMMIT \ | xargs rustfmt --edition=2018 --unstable-features --skip-children $ git diff $THIS_COMMIT # there should be no difference
Format libstd with rustfmt (Same strategy as rust-lang#66691.) This commit applies rustfmt with rust-lang/rust's default settings to files in src/libstd *that are not involved in any currently open PR* to minimize merge conflicts, and are not part of libstd/os (rust-lang#66818) or libstd/sys (rust-lang#66819). The list of files involved in open PRs was determined by querying GitHub's GraphQL API [with this script](https://gist.github.com/dtolnay/aa9c34993dc051a4f344d1b10e4487e8). With the list of files from the script in outstanding_files, the relevant commands were: $ find src/libstd -name '*.rs' \ | xargs rustfmt --edition=2018 --unstable-features --skip-children $ rg libstd outstanding_files | xargs git checkout -- Repeating this process several months apart should get us coverage of most of the rest of libstd. To confirm no funny business: $ git checkout $THIS_COMMIT^ $ git show --pretty= --name-only $THIS_COMMIT \ | xargs rustfmt --edition=2018 --unstable-features --skip-children $ git diff $THIS_COMMIT # there should be no difference
Format liballoc with rustfmt Same strategy as rust-lang#66691 -- as with my previous formatting PRs, I am avoiding causing merge conflicts in other PRs by only touches those files that are not involved in any currently open PR. Files that appear in new PRs between when this PR is opened and when it makes it to the top of the bors queue will be reverted from this PR. The list of files involved in open PRs is determined by querying GitHub's GraphQL API [with this script](https://gist.github.com/dtolnay/aa9c34993dc051a4f344d1b10e4487e8). With the list of files from the script in outstanding_files, the relevant commands were: ``` $ find src/liballoc -name '*.rs' \ | xargs rustfmt --edition=2018 --unstable-features --skip-children $ rg liballoc outstanding_files | xargs git checkout -- ``` To confirm no funny business: ``` $ git checkout $THIS_COMMIT^ $ git show --pretty= --name-only $THIS_COMMIT \ | xargs rustfmt --edition=2018 --unstable-features --skip-children $ git diff $THIS_COMMIT # there should be no difference ``` r? @Dylan-DPC
I am interested in whether we can begin cautious incremental progress on #66688 and assess along the way whether we can keep the disruption sufficiently small.
This PR applies rustfmt with default settings to files in src/libcore that are not involved in any currently open PR to minimize merge conflicts. The list of files involved in open PRs was determined by querying GitHub's GraphQL API with this script.
With the list of files from the script in
outstanding_files
, the relevant commands were:Repeating this process several months apart should get us coverage of most of the rest of libcore.