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

Format libcore with rustfmt #66691

Merged
merged 2 commits into from
Nov 27, 2019
Merged

Format libcore with rustfmt #66691

merged 2 commits into from
Nov 27, 2019

Conversation

dtolnay
Copy link
Member

@dtolnay dtolnay commented Nov 24, 2019

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:

$ 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.

@rust-highfive
Copy link
Collaborator

r? @sfackler

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 24, 2019
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 of your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
2019-11-24T10:09:05.7332366Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-11-24T10:09:05.7528559Z ##[command]git config gc.auto 0
2019-11-24T10:09:05.7581946Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-11-24T10:09:05.7628151Z ##[command]git config --get-all http.proxy
2019-11-24T10:09:05.7768230Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/66691/merge:refs/remotes/pull/66691/merge
---
2019-11-24T10:14:49.5329718Z     Finished release [optimized] target(s) in 1m 20s
2019-11-24T10:14:49.5421883Z tidy check
2019-11-24T10:14:50.7908062Z * 588 error codes
2019-11-24T10:14:50.7909340Z * highest error code: E0744
2019-11-24T10:14:50.9099199Z tidy error: /checkout/src/libcore/macros/mod.rs:800: malformed stability attribute: missing `feature` key
2019-11-24T10:14:50.9099665Z tidy error: /checkout/src/libcore/macros/mod.rs:904: malformed stability attribute: missing `feature` key
2019-11-24T10:14:50.9099799Z tidy error: /checkout/src/libcore/macros/mod.rs:1289: malformed stability attribute: missing `feature` key
2019-11-24T10:14:50.9100142Z tidy error: /checkout/src/libcore/macros/mod.rs:1307: malformed stability attribute: missing `feature` key
2019-11-24T10:14:50.9100209Z tidy error: /checkout/src/libcore/macros/mod.rs:1321: malformed stability attribute: missing `feature` key
2019-11-24T10:14:50.9100282Z tidy error: /checkout/src/libcore/macros/mod.rs:1335: malformed stability attribute: missing `feature` key
2019-11-24T10:14:50.9100331Z tidy error: /checkout/src/libcore/macros/mod.rs:1356: malformed stability attribute: missing `feature` key
2019-11-24T10:14:50.9100398Z tidy error: /checkout/src/libcore/macros/mod.rs:1369: malformed stability attribute: missing `feature` key
2019-11-24T10:14:50.9112362Z tidy error: /checkout/src/libcore/char/convert.rs:169: malformed stability attribute: missing `feature` key
2019-11-24T10:14:50.9196743Z tidy error: /checkout/src/libcore/num/bignum.rs:15: malformed stability attribute: missing `feature` key
2019-11-24T10:14:50.9200452Z tidy error: /checkout/src/libcore/num/flt2dec/mod.rs:119: malformed stability attribute: missing `feature` key
2019-11-24T10:14:50.9212628Z tidy error: /checkout/src/libcore/num/dec2flt/mod.rs:81: malformed stability attribute: missing `feature` key
2019-11-24T10:14:50.9212784Z tidy error: /checkout/src/libcore/num/dec2flt/mod.rs:186: malformed stability attribute: missing `feature` key
2019-11-24T10:14:50.9245033Z tidy error: /checkout/src/libcore/num/diy_float.rs:6: malformed stability attribute: missing `feature` key
2019-11-24T10:14:50.9285874Z tidy error: /checkout/src/libcore/panicking.rs:26: malformed stability attribute: missing `feature` key
2019-11-24T10:14:50.9362212Z tidy error: /checkout/src/libcore/ptr/unique.rs:30: malformed stability attribute: missing `feature` key
2019-11-24T10:14:50.9362895Z tidy error: /checkout/src/libcore/ffi.rs:38: malformed stability attribute: missing `feature` key
2019-11-24T10:14:50.9363922Z tidy error: /checkout/src/libcore/ffi.rs:45: malformed stability attribute: missing `feature` key
2019-11-24T10:14:50.9364078Z tidy error: /checkout/src/libcore/ffi.rs:71: malformed stability attribute: missing `feature` key
2019-11-24T10:14:50.9364139Z tidy error: /checkout/src/libcore/ffi.rs:93: malformed stability attribute: missing `feature` key
2019-11-24T10:14:50.9364197Z tidy error: /checkout/src/libcore/ffi.rs:113: malformed stability attribute: missing `feature` key
2019-11-24T10:14:50.9364274Z tidy error: /checkout/src/libcore/ffi.rs:133: malformed stability attribute: missing `feature` key
2019-11-24T10:14:50.9365933Z tidy error: /checkout/src/libcore/ffi.rs:153: malformed stability attribute: missing `feature` key
2019-11-24T10:14:50.9366235Z tidy error: /checkout/src/libcore/ffi.rs:171: malformed stability attribute: missing `feature` key
2019-11-24T10:14:50.9366472Z tidy error: /checkout/src/libcore/ffi.rs:210: malformed stability attribute: missing `feature` key
2019-11-24T10:14:50.9366740Z tidy error: /checkout/src/libcore/ffi.rs:231: malformed stability attribute: missing `feature` key
2019-11-24T10:14:50.9367115Z tidy error: /checkout/src/libcore/ffi.rs:245: malformed stability attribute: missing `feature` key
2019-11-24T10:14:50.9367329Z tidy error: /checkout/src/libcore/ffi.rs:260: malformed stability attribute: missing `feature` key
2019-11-24T10:14:50.9367515Z tidy error: /checkout/src/libcore/ffi.rs:286: malformed stability attribute: missing `feature` key
2019-11-24T10:14:50.9367708Z tidy error: /checkout/src/libcore/ffi.rs:311: malformed stability attribute: missing `feature` key
2019-11-24T10:14:50.9367901Z tidy error: /checkout/src/libcore/ffi.rs:318: malformed stability attribute: missing `feature` key
2019-11-24T10:14:50.9368095Z tidy error: /checkout/src/libcore/ffi.rs:326: malformed stability attribute: missing `feature` key
2019-11-24T10:14:50.9368291Z tidy error: /checkout/src/libcore/ffi.rs:351: malformed stability attribute: missing `feature` key
2019-11-24T10:14:50.9368657Z tidy error: /checkout/src/libcore/ffi.rs:369: malformed stability attribute: missing `feature` key
2019-11-24T10:14:50.9369153Z tidy error: /checkout/src/libcore/clone.rs:150: malformed stability attribute: missing `feature` key
2019-11-24T10:14:50.9369414Z tidy error: /checkout/src/libcore/clone.rs:160: malformed stability attribute: missing `feature` key
2019-11-24T10:14:51.3648577Z tidy error: The Unstable Book has a 'library feature' section 'asm' which doesn't correspond to an unstable library feature
2019-11-24T10:14:51.3648911Z tidy error: The Unstable Book has a 'library feature' section 'c-void-variant' which doesn't correspond to an unstable library feature
2019-11-24T10:14:51.3649289Z tidy error: The Unstable Book has a 'library feature' section 'char-error-internals' which doesn't correspond to an unstable library feature
2019-11-24T10:14:51.3649929Z tidy error: The Unstable Book has a 'library feature' section 'concat-idents' which doesn't correspond to an unstable library feature
2019-11-24T10:14:51.3650213Z tidy error: The Unstable Book has a 'library feature' section 'core-panic' which doesn't correspond to an unstable library feature
2019-11-24T10:14:51.3650467Z tidy error: The Unstable Book has a 'library feature' section 'core-private-bignum' which doesn't correspond to an unstable library feature
2019-11-24T10:14:51.3650737Z tidy error: The Unstable Book has a 'library feature' section 'core-private-diy-float' which doesn't correspond to an unstable library feature
2019-11-24T10:14:51.3650988Z tidy error: The Unstable Book has a 'library feature' section 'dec2flt' which doesn't correspond to an unstable library feature
2019-11-24T10:14:51.3651234Z tidy error: The Unstable Book has a 'library feature' section 'derive-clone-copy' which doesn't correspond to an unstable library feature
2019-11-24T10:14:51.3651720Z tidy error: The Unstable Book has a 'library feature' section 'flt2dec' which doesn't correspond to an unstable library feature
2019-11-24T10:14:51.3651961Z tidy error: The Unstable Book has a 'library feature' section 'global-asm' which doesn't correspond to an unstable library feature
2019-11-24T10:14:51.3652211Z tidy error: The Unstable Book has a 'library feature' section 'trace-macros' which doesn't correspond to an unstable library feature
2019-11-24T10:14:52.0044858Z Found 485 error codes
2019-11-24T10:14:52.0044961Z Found 0 error codes with no tests
2019-11-24T10:14:52.0045007Z Done!
2019-11-24T10:14:52.0045050Z some tidy checks failed
2019-11-24T10:14:52.0045050Z some tidy checks failed
2019-11-24T10:14:52.0051665Z 
2019-11-24T10:14:52.0051747Z 
2019-11-24T10:14:52.0052559Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/tidy" "/checkout/src" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "--no-vendor"
2019-11-24T10:14:52.0052698Z 
2019-11-24T10:14:52.0052721Z 
2019-11-24T10:14:52.0057627Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
2019-11-24T10:14:52.0057876Z Build completed unsuccessfully in 0:01:24
2019-11-24T10:14:52.0057876Z Build completed unsuccessfully in 0:01:24
2019-11-24T10:14:52.0104521Z == clock drift check ==
2019-11-24T10:14:52.0115590Z   local time: Sun Nov 24 10:14:52 UTC 2019
2019-11-24T10:14:52.7133260Z   network time: Sun, 24 Nov 2019 10:14:52 GMT
2019-11-24T10:14:52.7134969Z == end clock drift check ==
2019-11-24T10:14:53.5386923Z 
2019-11-24T10:14:53.5499492Z ##[error]Bash exited with code '1'.
2019-11-24T10:14:53.5522460Z ##[section]Starting: Checkout
2019-11-24T10:14:53.5523857Z ==============================================================================
2019-11-24T10:14:53.5524088Z Task         : Get sources
2019-11-24T10:14:53.5524155Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

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 @TimNN. (Feature Requests)

@dtolnay
Copy link
Member Author

dtolnay commented Nov 24, 2019

I need to update tidy to accept feature names on their own line. Will take care of that in a separate PR.

#[unstable(
    feature = "derive_clone_copy",

@petrochenkov
Copy link
Contributor

This PR applies rustfmt with default settings to files

"Default" here means https://github.com/rust-lang/rust/blob/master/rustfmt.toml or really default?

@petrochenkov
Copy link
Contributor

cc #65939

@dtolnay
Copy link
Member Author

dtolnay commented Nov 24, 2019

Ah, it's with that rustfmt.toml. It got picked up from running rustfmt in the same directory.

@sfackler
Copy link
Member

r=me

@bors
Copy link
Contributor

bors commented Nov 25, 2019

☔ The latest upstream changes (presumably #66739) made this pull request unmergeable. Please resolve the merge conflicts.

@dtolnay
Copy link
Member Author

dtolnay commented Nov 27, 2019

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):

  • src/libcore/cmp.rs
  • src/libcore/panicking.rs

and 6 files that appear in newly opened PRs:

  • src/libcore/fmt/builders.rs
  • src/libcore/fmt/num.rs
  • src/libcore/hint.rs
  • src/libcore/iter/traits/collect.rs
  • src/libcore/num/f32.rs
  • src/libcore/ops/try.rs

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 of your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
2019-11-27T05:12:58.1860438Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-11-27T05:12:59.1024192Z ##[command]git config gc.auto 0
2019-11-27T05:12:59.1028968Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-11-27T05:12:59.1032615Z ##[command]git config --get-all http.proxy
2019-11-27T05:12:59.1037541Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/66691/merge:refs/remotes/pull/66691/merge
---
2019-11-27T06:06:36.2047370Z .................................................................................................... 1600/9297
2019-11-27T06:06:40.7478804Z .................................................................................................... 1700/9297
2019-11-27T06:06:52.4379495Z ..................................i................................................................. 1800/9297
2019-11-27T06:06:59.6396497Z .................................................................................................... 1900/9297
2019-11-27T06:07:12.5217819Z ...................iiiii............................................................................ 2000/9297
2019-11-27T06:07:21.6646291Z .................................................................................................... 2200/9297
2019-11-27T06:07:23.9091996Z .................................................................................................... 2300/9297
2019-11-27T06:07:28.5293098Z .................................................................................................... 2400/9297
2019-11-27T06:07:47.7595953Z .................................................................................................... 2500/9297
---
2019-11-27T06:10:16.3298542Z ....................i...............i............................................................... 4800/9297
2019-11-27T06:10:25.7320500Z .................................................................................................... 4900/9297
2019-11-27T06:10:31.0244475Z .................................................................................................... 5000/9297
2019-11-27T06:10:38.7717832Z .................................................................................................... 5100/9297
2019-11-27T06:10:45.5267133Z .........................ii.ii...........i.......................................................... 5200/9297
2019-11-27T06:10:53.8310615Z .................................................................................................... 5400/9297
2019-11-27T06:11:03.1564240Z ...........................................................................................F...F.... 5500/9297
2019-11-27T06:11:09.3596932Z .......i............................................................................................ 5600/9297
2019-11-27T06:11:15.0795488Z ............F....................................................................................... 5700/9297
2019-11-27T06:11:15.0795488Z ............F....................................................................................... 5700/9297
2019-11-27T06:11:25.0958169Z .............................................................................................ii...i. 5800/9297
2019-11-27T06:11:37.0742049Z .ii...........i..................................................................................... 5900/9297
2019-11-27T06:11:53.9517351Z .................................................................................................... 6100/9297
2019-11-27T06:11:57.5466202Z .................................................................................................... 6200/9297
2019-11-27T06:11:57.5466202Z .................................................................................................... 6200/9297
2019-11-27T06:12:10.4885255Z ................i..ii............................................................................... 6300/9297
2019-11-27T06:12:28.4248281Z ....................................................................................i............... 6500/9297
2019-11-27T06:12:30.5309540Z .................................................................................................... 6600/9297
2019-11-27T06:12:32.5934562Z ...........................................................................i........................ 6700/9297
2019-11-27T06:12:35.1036431Z .................................................................................................... 6800/9297
---
2019-11-27T06:16:52.7832213Z failures:
2019-11-27T06:16:52.7868688Z 
2019-11-27T06:16:52.7869599Z ---- [ui] ui/macros/macro-comma-support-rpass.rs#core stdout ----
2019-11-27T06:16:52.7870047Z 
2019-11-27T06:16:52.7870743Z error in revision `core`: test compilation failed although it shouldn't!
2019-11-27T06:16:52.7871110Z status: exit code: 1
2019-11-27T06:16:52.7872167Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/macros/macro-comma-support-rpass.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--cfg" "core" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/macros/macro-comma-support-rpass.core/a" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--test" "-C" "debug_assertions=yes" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/macros/macro-comma-support-rpass.core/auxiliary"
2019-11-27T06:16:52.7873195Z ------------------------------------------
2019-11-27T06:16:52.7873475Z 
2019-11-27T06:16:52.7873937Z ------------------------------------------
2019-11-27T06:16:52.7874204Z stderr:
---
2019-11-27T06:16:52.7878562Z 
2019-11-27T06:16:52.7878756Z 
2019-11-27T06:16:52.7879269Z ---- [ui] ui/macros/macro-comma-support-rpass.rs#std stdout ----
2019-11-27T06:16:52.7879533Z 
2019-11-27T06:16:52.7880202Z error in revision `std`: test compilation failed although it shouldn't!
2019-11-27T06:16:52.7880488Z status: exit code: 1
2019-11-27T06:16:52.7881457Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/macros/macro-comma-support-rpass.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--cfg" "std" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/macros/macro-comma-support-rpass.std/a" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--test" "-C" "debug_assertions=yes" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/macros/macro-comma-support-rpass.std/auxiliary"
2019-11-27T06:16:52.7882233Z ------------------------------------------
2019-11-27T06:16:52.7882490Z 
2019-11-27T06:16:52.7882950Z ------------------------------------------
2019-11-27T06:16:52.7883213Z stderr:
---
2019-11-27T06:16:52.7888539Z 
2019-11-27T06:16:52.7889008Z 7 error: cannot find a built-in macro with name `line`
2019-11-27T06:16:52.7889532Z 8   --> <::core::macros::builtin::line macros>:1:1
2019-11-27T06:16:52.7889792Z 9    |
2019-11-27T06:16:52.7890196Z - LL | () => { }
2019-11-27T06:16:52.7893329Z -    | ^^^^^^^^^
2019-11-27T06:16:52.7894248Z + LL | () => { } ;
2019-11-27T06:16:52.7894586Z 12 
2019-11-27T06:16:52.7894746Z 13 error: aborting due to 2 previous errors
2019-11-27T06:16:52.7894872Z 14 
2019-11-27T06:16:52.7894980Z 
2019-11-27T06:16:52.7894980Z 
2019-11-27T06:16:52.7895103Z 
2019-11-27T06:16:52.7895236Z The actual stderr differed from the expected stderr.
2019-11-27T06:16:52.7895751Z Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/macros/unknown-builtin/unknown-builtin.stderr
2019-11-27T06:16:52.7896210Z To update references, rerun the tests and pass the `--bless` flag
2019-11-27T06:16:52.7896648Z To only update this specific test, also pass `--test-args macros/unknown-builtin.rs`
2019-11-27T06:16:52.7896980Z error: 1 errors occurred comparing output.
2019-11-27T06:16:52.7897109Z status: exit code: 1
2019-11-27T06:16:52.7897109Z status: exit code: 1
2019-11-27T06:16:52.7899036Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/macros/unknown-builtin.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/macros/unknown-builtin" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/macros/unknown-builtin/auxiliary" "-A" "unused"
2019-11-27T06:16:52.7899774Z ------------------------------------------
2019-11-27T06:16:52.7900104Z 
2019-11-27T06:16:52.7900455Z ------------------------------------------
2019-11-27T06:16:52.7900648Z stderr:
2019-11-27T06:16:52.7900648Z stderr:
2019-11-27T06:16:52.7900982Z ------------------------------------------
2019-11-27T06:16:52.7901360Z error: cannot find a built-in macro with name `unknown`
2019-11-27T06:16:52.7901766Z   --> /checkout/src/test/ui/macros/unknown-builtin.rs:6:1
2019-11-27T06:16:52.7901940Z    |
2019-11-27T06:16:52.7902349Z LL | macro_rules! unknown { () => () } //~ ERROR cannot find a built-in macro with name `unknown`
2019-11-27T06:16:52.7902640Z 
2019-11-27T06:16:52.7902996Z error: cannot find a built-in macro with name `line`
2019-11-27T06:16:52.7903552Z   --> <::core::macros::builtin::line macros>:1:1
2019-11-27T06:16:52.7903730Z    |
2019-11-27T06:16:52.7903730Z    |
2019-11-27T06:16:52.7903872Z LL | () => { } ;
2019-11-27T06:16:52.7904103Z 
2019-11-27T06:16:52.7904247Z error: aborting due to 2 previous errors
2019-11-27T06:16:52.7904354Z 
2019-11-27T06:16:52.7904469Z 
---
2019-11-27T06:16:52.7940611Z thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:537:22
2019-11-27T06:16:52.7940815Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
2019-11-27T06:16:52.7940999Z 
2019-11-27T06:16:52.7941112Z 
2019-11-27T06:16:52.7942772Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/ui" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "ui" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-6.0/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--quiet" "--llvm-version" "6.0.0\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
2019-11-27T06:16:52.7943663Z 
2019-11-27T06:16:52.7943688Z 
2019-11-27T06:16:52.7943729Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
2019-11-27T06:16:52.7943783Z Build completed unsuccessfully in 0:58:15
2019-11-27T06:16:52.7943783Z Build completed unsuccessfully in 0:58:15
2019-11-27T06:16:52.7966478Z == clock drift check ==
2019-11-27T06:16:52.7983124Z   local time: Wed Nov 27 06:16:52 UTC 2019
2019-11-27T06:16:53.3325626Z   network time: Wed, 27 Nov 2019 06:16:53 GMT
2019-11-27T06:16:53.3328383Z == end clock drift check ==
2019-11-27T06:16:54.0992582Z 
2019-11-27T06:16:54.1119141Z ##[error]Bash exited with code '1'.
2019-11-27T06:16:54.1152743Z ##[section]Starting: Checkout
2019-11-27T06:16:54.1154887Z ==============================================================================
2019-11-27T06:16:54.1154943Z Task         : Get sources
2019-11-27T06:16:54.1154992Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

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 @TimNN. (Feature Requests)

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.
@dtolnay
Copy link
Member Author

dtolnay commented Nov 27, 2019

  • Updated UI test in src/test/ui/macros/unknown-builtin.stderr, which includes a line from a builtin macro (166471e)
  • Updated to pass --edition=2018 to rustfmt or else it rewrites $crate::r#try!($expr) to $crate::try!($expr)
  • Updated

    rust/src/libcore/macros/mod.rs

    Lines 1296 to 1297 in 809e180

    #[unstable(soft, feature = "test", issue = "50297",
    reason = "`bench` is a part of custom test frameworks which are unstable")]

    to reorder feature before soft so that tidy sees feature on the line it expects

@dtolnay
Copy link
Member Author

dtolnay commented Nov 27, 2019

@bors r=sfackler

@bors
Copy link
Contributor

bors commented Nov 27, 2019

📌 Commit 166471e has been approved by sfackler

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 27, 2019
@bors
Copy link
Contributor

bors commented Nov 27, 2019

⌛ Testing commit 166471e with merge 04e69e4...

bors added a commit that referenced this pull request Nov 27, 2019
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.
@bors
Copy link
Contributor

bors commented Nov 27, 2019

☀️ Test successful - checks-azure
Approved by: sfackler
Pushing 04e69e4 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Nov 27, 2019
@bors bors merged commit 166471e into rust-lang:master Nov 27, 2019
Comment on lines -48 to +54
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;
Copy link
Member

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.

Copy link
Member Author

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.

bors added a commit that referenced this pull request Nov 30, 2019
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
dtolnay added a commit to dtolnay/rust that referenced this pull request Nov 30, 2019
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
dtolnay added a commit to dtolnay/rust that referenced this pull request Nov 30, 2019
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
dtolnay added a commit to dtolnay/rust that referenced this pull request Nov 30, 2019
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
Centril added a commit to Centril/rust that referenced this pull request Dec 1, 2019
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants