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 Rust code #57318

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
8 participants
@Mark-Simulacrum
Copy link
Member

Mark-Simulacrum commented Jan 3, 2019

Posting this for review; will be rebasing and attempting to merge this weekend.

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented Jan 3, 2019

r? @nikomatsakis

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

@Mark-Simulacrum

This comment has been minimized.

Copy link
Member

Mark-Simulacrum commented Jan 3, 2019

In some short discussion we realized that this would make backporting a pain so we'll be landing this closer to the release, somewhere around the 15th.

r? @pietroalbini

@Mark-Simulacrum

This comment has been minimized.

Copy link
Member

Mark-Simulacrum commented Jan 3, 2019

__CARGO_TEST_CHANNEL_OVERRIDE_DO_NOT_USE_THIS=nightly CFG_RELEASE_CHANNEL=nightly cargo +stable fmt

This was the command used to produce these results.

These environment variables are (clearly) not for use -- there are no stability guarantees for these, they may be removed, stop working, and otherwise at any point. The command is only here in case anyone wants to reproduce the results within this PR.

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented Jan 3, 2019

The job x86_64-gnu-llvm-6.0 of your PR failed on Travis (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.
travis_time:end:00532620:start=1546554357768963385,finish=1546554361203906509,duration=3434943124
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
Setting environment variables from .travis.yml
$ export IMAGE=x86_64-gnu-llvm-6.0
---

[00:03:01] travis_fold:start:tidy
travis_time:start:tidy
tidy check
[00:03:01] tidy error: /checkout/src/librustc_codegen_ssa/mir/mod.rs:587: line longer than 100 chars
[00:03:01] tidy error: /checkout/src/librustc_codegen_ssa/mir/mod.rs:588: line longer than 100 chars
[00:03:01] tidy error: /checkout/src/librustc_codegen_ssa/mir/block.rs:590: line longer than 100 chars
[00:03:01] tidy error: /checkout/src/librustc_codegen_ssa/mir/block.rs:591: line longer than 100 chars
[00:03:01] tidy error: /checkout/src/librustc_codegen_ssa/base.rs:236: line longer than 100 chars
[00:03:01] tidy error: /checkout/src/librustc_resolve/resolve_imports.rs:49: line longer than 100 chars
[00:03:01] tidy error: /checkout/src/librustc_resolve/resolve_imports.rs:277: line longer than 100 chars
[00:03:01] tidy error: /checkout/src/librustc_resolve/resolve_imports.rs:1134: line longer than 100 chars
[00:03:01] tidy error: /checkout/src/librustc_resolve/resolve_imports.rs:1174: line longer than 100 chars
[00:03:01] tidy error: /checkout/src/librustc_resolve/resolve_imports.rs:1175: line longer than 100 chars
[00:03:01] tidy error: /checkout/src/librustc_resolve/resolve_imports.rs:1346: line longer than 100 chars
[00:03:01] tidy error: /checkout/src/librustc_resolve/resolve_imports.rs:1347: line longer than 100 chars
[00:03:01] tidy error: /checkout/src/librustc_resolve/lib.rs:3292: line longer than 100 chars
[00:03:01] tidy error: /checkout/src/librustc_resolve/lib.rs:3293: line longer than 100 chars
[00:03:01] tidy error: /checkout/src/librustc_codegen_llvm/back/write.rs:605: line longer than 100 chars
[00:03:01] tidy error: /checkout/src/librustc_codegen_llvm/consts.rs:284: line longer than 100 chars
[00:03:01] tidy error: /checkout/src/libcore/iter/mod.rs:1924: line longer than 100 chars
[00:03:01] tidy error: /checkout/src/libcore/iter/iterator.rs:47: line longer than 100 chars
[00:03:01] tidy error: /checkout/src/libcore/iter/iterator.rs:60: line longer than 100 chars
[00:03:01] tidy error: /checkout/src/libcore/iter/iterator.rs:66: line longer than 100 chars
[00:03:01] tidy error: /checkout/src/libcore/iter/iterator.rs:84: line longer than 100 chars
[00:03:01] tidy error: /checkout/src/librustc_lint/lib.rs:310: line longer than 100 chars
[00:03:01] tidy error: /checkout/src/librustc_mir/borrow_check/mutability_errors.rs:288: line longer than 100 chars
[00:03:01] tidy error: /checkout/src/librustc_mir/hair/pattern/_match.rs:1282: line longer than 100 chars
[00:03:01] tidy error: /checkout/src/librustc_mir/hair/pattern/_match.rs:1283: line longer than 100 chars
[00:03:01] tidy error: /checkout/src/librustc_mir/const_eval.rs:723: line longer than 100 chars
[00:03:01] tidy error: /checkout/src/librustc_mir/interpret/operand.rs:454: line longer than 100 chars
[00:03:01] tidy error: /checkout/src/librustc_mir/monomorphize/collector.rs:859: line longer than 100 chars
[00:03:01] tidy error: /checkout/src/librustdoc/core.rs:512: line longer than 100 chars
[00:03:01] tidy error: /checkout/src/librustdoc/clean/blanket_impl.rs:130: line longer than 100 chars
[00:03:01] tidy error: /checkout/src/libsyntax/parse/parser.rs:7988: line longer than 100 chars
[00:03:01] tidy error: /checkout/src/libsyntax_ext/test.rs:147: line longer than 100 chars
[00:03:01] tidy error: /checkout/src/librustc/ty/constness.rs:27: line longer than 100 chars
[00:03:01] tidy error: /checkout/src/librustc/middle/mem_categorization.rs:96: line longer than 100 chars
[00:03:01] tidy error: /checkout/src/librustc/traits/mod.rs:459: line longer than 100 chars
[00:03:01] tidy error: /checkout/src/librustc/infer/canonical/query_response.rs:51: line longer than 100 chars
[00:03:01] tidy error: /checkout/src/librustc/infer/error_reporting/nice_region_error/outlives_closure.rs:78: line longer than 100 chars
[00:03:01] tidy error: /checkout/src/librustc/infer/error_reporting/nice_region_error/outlives_closure.rs:95: line longer than 100 chars
[00:03:01] tidy error: /checkout/src/librustc/infer/error_reporting/nice_region_error/outlives_closure.rs:99: line longer than 100 chars
[00:03:01] tidy error: /checkout/src/librustc_typeck/astconv.rs:2176: line longer than 100 chars
[00:03:01] note: Run with `RUST_BACKTRACE=1` for a backtrace.
[00:03:01] 
[00:03:01] 
[00:03:01] 
[00:03:01] 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" "--quiet"
[00:03:01] 
[00:03:01] 
[00:03:01] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
[00:03:01] Build completed unsuccessfully in 0:00:41
[00:03:01] Build completed unsuccessfully in 0:00:41
[00:03:01] Makefile:69: recipe for target 'tidy' failed
[00:03:01] make: *** [tidy] Error 1
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:10d58a1c
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Thu Jan  3 22:29:11 UTC 2019
---
travis_time:end:21514100:start=1546554552052851296,finish=1546554552057135781,duration=4284485
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:144589b6
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb --batch -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:20281618
travis_time:start:20281618
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:00e3e928
$ dmesg | grep -i kill

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)

@mark-i-m

This comment has been minimized.

Copy link
Contributor

mark-i-m commented Jan 4, 2019

@Mark-Simulacrum Would you like me to fix up the "remove all licenses" PR too?

@mark-i-m

This comment has been minimized.

Copy link
Contributor

mark-i-m commented Jan 4, 2019

Note that I will be out of town starting Jan 5, so I won't have access to rebase...

@mark-i-m

This comment has been minimized.

Copy link
Contributor

mark-i-m commented Jan 4, 2019

For reference: #53654

@mark-i-m

This comment has been minimized.

Copy link
Contributor

mark-i-m commented Jan 4, 2019

Oh, I just noticed it was already done! 🎉

@Centril

This comment has been minimized.

Copy link
Contributor

Centril commented Jan 4, 2019

@Mark-Simulacrum

In some short discussion we realized that this would make backporting a pain so we'll be landing this closer to the release, somewhere around the 15th.

I'd rather do it either very soon (1-2 days from now) or postpone this until after master=>beta promotion happens as there are some stabilization PRs that, if everything goes well, will be FCP-complete right around 13-15th; I'd prefer not to tree-close around those dates.

@varkor

This comment has been minimized.

Copy link
Member

varkor commented Jan 4, 2019

(It's really hard to view the changes on GitHub, so sorry for the questions that might have obvious answers.)

  • Does this modify x.py tidy to require code to be formatted according to rustfmt?
  • Does this simply use the standard configurations for rustfmt and have we established exactly which configurations ought to be used? (E.g. see @petrochenkov's post on IRLO.)
@bors

This comment has been minimized.

Copy link
Contributor

bors commented Jan 4, 2019

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

@mark-i-m

This comment has been minimized.

Copy link
Contributor

mark-i-m commented Jan 4, 2019

Personally, I would hope that there are no actual changes in this PR. I would rather turn on tidy in another PR and fix any formatting that changed since this PR.

@varkor

This comment has been minimized.

Copy link
Member

varkor commented Jan 4, 2019

Personally, I would hope that there are no actual changes in this PR.

They definitely ought to be in separate commits, and I'd probably be inclined to go for separate PRs too.

I think we'd benefit from turning on tidy first (which will only lint changed files anyway) and then formatting afterwards, so we don't have to make more than one formatting PR.

@mark-i-m

This comment has been minimized.

Copy link
Contributor

mark-i-m commented Jan 4, 2019

Checking only changed files is a good idea, but I didn’t know we could do that.

@mark-i-m

This comment has been minimized.

Copy link
Contributor

mark-i-m commented Jan 14, 2019

Is the current plan to revive this near the end of this week?

@Mark-Simulacrum

This comment has been minimized.

Copy link
Member

Mark-Simulacrum commented Jan 14, 2019

I've decided to table this for a release cycle until I get a chance to sit down -- maybe at the all hands -- with a few of the stake holders and hash out exactly what we want from it: options to rustfmt, etc.

I'm going to close this for now to avoid cluttering the queue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment