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

Unify all uses of 'gcx and 'tcx. #61817

Merged
merged 2 commits into from Jun 14, 2019

Conversation

Projects
None yet
9 participants
@eddyb
Copy link
Member

commented Jun 13, 2019

This is made possible by @Zoxc landing #57214 (see #57214 (comment) for the decision).

A bit of context for the approach: just like #61722, this is not how I originally intended to go about this, but @Zoxc and my own experimentation independently resulted in the same conclusion:
The interim alias type TyCx<'tcx> = TyCtxt<'tcx, 'tcx>; attempt required more work (adding uses), even only for handling the TyCtxt<'tcx, 'tcx> case and not the general TyCtxt<'gcx, 'tcx> one.

What this PR is based on is the realization that 'gcx is a special-enough name that it can be replaced, without caring for context, with 'tcx, and then repetitions of the name 'tcx be compacted away.
After that, only a small number of error categories remained, each category easily dealt with with either more mass replacements (e.g. TyCtxt<'tcx, '_> -> TyCtxt<'tcx>) or by hand.

For the rustfmt commit, I used rust-lang/rustfmt#1324 (comment), and manually filtered out some noise, like in #61735 and #61722, and like the latter, there was also a weird bug to work around.
It should be reviewed separately, and dropped if unwanted (in this PR it's pretty significant).

cc @rust-lang/compiler r? @nikomatsakis

@Centril

This comment has been minimized.

Copy link
Member

commented Jun 13, 2019

@bors treeclosed=500

@Centril

This comment has been minimized.

Copy link
Member

commented Jun 13, 2019

@bors treeclosed-

That was a bit premature 🤣

@rust-highfive

This comment was marked as resolved.

Copy link
Collaborator

commented Jun 14, 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:048cd080:start=1560468441115487915,finish=1560468443698068261,duration=2582580346
$ 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
$ export GCP_CACHE_BUCKET=rust-lang-ci-cache
$ export AWS_ACCESS_KEY_ID=AKIA46X5W6CZEJZ6XT55
---
    99% |███████████████████████████████▉| 5.5MB 74.9MB/s eta 0:00:01
    99% |████████████████████████████████| 5.5MB 74.3MB/s eta 0:00:01
    99% |████████████████████████████████| 5.5MB 74.8MB/s eta 0:00:01
    100% |████████████████████████████████| 5.5MB 4.1MB/s 
Requirement already satisfied: PyYAML<=5.1,>=3.10; python_version != "2.6" in /usr/lib/python2.7/dist-packages (from awscli) (3.11)
  Downloading https://files.pythonhosted.org/packages/e1/ae/baedc9cb175552e95f3395c43055a6a5e125ae4d48a1d7a924baca83e92e/rsa-3.4.2-py2.py3-none-any.whl (46kB)
    21% |███████                         | 10kB 21.9MB/s eta 0:00:01
    43% |██████████████                  | 20kB 26.7MB/s eta 0:00:01
    65% |█████████████████████           | 30kB 31.7MB/s eta 0:00:01
---
travis_time:start:test_assembly
Check compiletest suite=assembly mode=assembly (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:07:38] 
[01:07:38] running 9 tests
[01:07:38] iiiiiiiii
[01:07:38] 
[01:07:38]  finished in 0.155
[01:07:38] travis_fold:end:test_assembly

---
travis_time:start:test_debuginfo
Check compiletest suite=debuginfo mode=debuginfo-gdb+lldb (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:07:54] 
[01:07:54] running 122 tests
[01:08:20] .iiiii...i.....i..i...i..i.i.i..i.ii..i.i.....i..i....i..........iiii..........i...ii...i.......ii.i 100/122
[01:08:25] .i.i......iii.i.....ii
[01:08:25] 
[01:08:25]  finished in 30.875
[01:08:25] travis_fold:end:test_debuginfo

---
travis_time:start:test_ui-fulldeps
Check compiletest suite=ui-fulldeps mode=ui (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:08:25] 
[01:08:25] running 24 tests
[01:08:32] ......FF................
[01:08:32] 
[01:08:32] ---- [ui] ui-fulldeps/internal-lints/pass_ty_by_ref.rs stdout ----
[01:08:32] diff of stderr:
[01:08:32] 
[01:08:32] 
[01:08:32] 14   --> $DIR/pass_ty_by_ref.rs:15:18
[01:08:32] 15    |
[01:08:32] 16 LL |     ty_ctxt_ref: &TyCtxt<'_>,
[01:08:32] -    |                  ^^^^^^^^^^^^^^^ help: try passing by value: `TyCtxt<'_>`
[01:08:32] +    |                  ^^^^^^^^^^^ help: try passing by value: `TyCtxt<'_>`
[01:08:32] 19 error: passing `Ty<'_>` by reference
[01:08:32] 20   --> $DIR/pass_ty_by_ref.rs:19:28
[01:08:32] 
[01:08:32] 26   --> $DIR/pass_ty_by_ref.rs:19:55
[01:08:32] 26   --> $DIR/pass_ty_by_ref.rs:19:55
[01:08:32] 27    |
[01:08:32] 28 LL | fn ty_multi_ref(ty_multi: &&Ty<'_>, ty_ctxt_multi: &&&&TyCtxt<'_>) {}
[01:08:32] -    |                                                       ^^^^^^^^^^^^^^^ help: try passing by value: `TyCtxt<'_>`
[01:08:32] +    |                                                       ^^^^^^^^^^^ help: try passing by value: `TyCtxt<'_>`
[01:08:32] 31 error: passing `Ty<'_>` by reference
[01:08:32] 32   --> $DIR/pass_ty_by_ref.rs:26:17
[01:08:32] 
[01:08:32] 38   --> $DIR/pass_ty_by_ref.rs:28:22
[01:08:32] 38   --> $DIR/pass_ty_by_ref.rs:28:22
[01:08:32] 39    |
[01:08:32] 40 LL |         ty_ctxt_ref: &TyCtxt<'_>,
[01:08:32] -    |                      ^^^^^^^^^^^^^^^ help: try passing by value: `TyCtxt<'_>`
[01:08:32] +    |                      ^^^^^^^^^^^ help: try passing by value: `TyCtxt<'_>`
[01:08:32] 43 error: passing `Ty<'_>` by reference
[01:08:32] 44   --> $DIR/pass_ty_by_ref.rs:31:41
[01:08:32] 
[01:08:32] 50   --> $DIR/pass_ty_by_ref.rs:31:68
[01:08:32] 50   --> $DIR/pass_ty_by_ref.rs:31:68
[01:08:32] 51    |
[01:08:32] 52 LL |     fn ty_multi_ref_in_trait(ty_multi: &&Ty<'_>, ty_ctxt_multi: &&&&TyCtxt<'_>);
[01:08:32] -    |                                                                    ^^^^^^^^^^^^^^^ help: try passing by value: `TyCtxt<'_>`
[01:08:32] +    |                                                                    ^^^^^^^^^^^ help: try passing by value: `TyCtxt<'_>`
[01:08:32] 55 error: passing `Ty<'_>` by reference
[01:08:32] 56   --> $DIR/pass_ty_by_ref.rs:53:17
[01:08:32] 
[01:08:32] 62   --> $DIR/pass_ty_by_ref.rs:55:22
[01:08:32] 62   --> $DIR/pass_ty_by_ref.rs:55:22
[01:08:32] 63    |
[01:08:32] 64 LL |         ty_ctxt_ref: &TyCtxt<'_>,
[01:08:32] -    |                      ^^^^^^^^^^^^^^^ help: try passing by value: `TyCtxt<'_>`
[01:08:32] +    |                      ^^^^^^^^^^^ help: try passing by value: `TyCtxt<'_>`
[01:08:32] 67 error: passing `Ty<'_>` by reference
[01:08:32] 68   --> $DIR/pass_ty_by_ref.rs:59:38
[01:08:32] 
[01:08:32] 74   --> $DIR/pass_ty_by_ref.rs:59:65
[01:08:32] 74   --> $DIR/pass_ty_by_ref.rs:59:65
[01:08:32] 75    |
[01:08:32] 76 LL |     fn ty_multi_ref_assoc(ty_multi: &&Ty<'_>, ty_ctxt_multi: &&&&TyCtxt<'_>) {}
[01:08:32] -    |                                                                 ^^^^^^^^^^^^^^^ help: try passing by value: `TyCtxt<'_>`
[01:08:32] +    |                                                                 ^^^^^^^^^^^ help: try passing by value: `TyCtxt<'_>`
[01:08:32] 79 error: aborting due to 12 previous errors
[01:08:32] 80 
[01:08:32] 
[01:08:32] 
[01:08:32] 
[01:08:32] The actual stderr differed from the expected stderr.
[01:08:32] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui-fulldeps/internal-lints/pass_ty_by_ref/pass_ty_by_ref.stderr
[01:08:32] To update references, rerun the tests and pass the `--bless` flag
[01:08:32] To only update this specific test, also pass `--test-args internal-lints/pass_ty_by_ref.rs`
[01:08:32] error: 1 errors occurred comparing output.
[01:08:32] status: exit code: 1
[01:08:32] status: exit code: 1
[01:08:32] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui-fulldeps/internal-lints/pass_ty_by_ref.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-fulldeps/internal-lints/pass_ty_by_ref" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-Z" "unstable-options" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui-fulldeps/internal-lints/pass_ty_by_ref/auxiliary" "-A" "unused"
[01:08:32] ------------------------------------------
[01:08:32] 
[01:08:32] ------------------------------------------
[01:08:32] stderr:
[01:08:32] stderr:
[01:08:32] ------------------------------------------
[01:08:32] error: passing `Ty<'_>` by reference
[01:08:32]   --> /checkout/src/test/ui-fulldeps/internal-lints/pass_ty_by_ref.rs:13:13
[01:08:32]    |
[01:08:32] LL |     ty_ref: &Ty<'_>, //~ ERROR passing `Ty<'_>` by reference
[01:08:32]    |             ^^^^^^^ help: try passing by value: `Ty<'_>`
[01:08:32] note: lint level defined here
[01:08:32]   --> /checkout/src/test/ui-fulldeps/internal-lints/pass_ty_by_ref.rs:4:9
[01:08:32]    |
[01:08:32]    |
[01:08:32] LL | #![deny(ty_pass_by_reference)]
[01:08:32] 
[01:08:32] error: passing `TyCtxt<'_>` by reference
[01:08:32]   --> /checkout/src/test/ui-fulldeps/internal-lints/pass_ty_by_ref.rs:15:18
[01:08:32]    |
[01:08:32]    |
[01:08:32] LL |     ty_ctxt_ref: &TyCtxt<'_>, //~ ERROR passing `TyCtxt<'_>` by reference
[01:08:32]    |                  ^^^^^^^^^^^ help: try passing by value: `TyCtxt<'_>`
[01:08:32] error: passing `Ty<'_>` by reference
[01:08:32]   --> /checkout/src/test/ui-fulldeps/internal-lints/pass_ty_by_ref.rs:19:28
[01:08:32]    |
[01:08:32]    |
[01:08:32] LL | fn ty_multi_ref(ty_multi: &&Ty<'_>, ty_ctxt_multi: &&&&TyCtxt<'_>) {}
[01:08:32]    |                            ^^^^^^^ help: try passing by value: `Ty<'_>`
[01:08:32] error: passing `TyCtxt<'_>` by reference
[01:08:32]   --> /checkout/src/test/ui-fulldeps/internal-lints/pass_ty_by_ref.rs:19:55
[01:08:32]    |
[01:08:32]    |
[01:08:32] LL | fn ty_multi_ref(ty_multi: &&Ty<'_>, ty_ctxt_multi: &&&&TyCtxt<'_>) {}
[01:08:32]    |                                                       ^^^^^^^^^^^ help: try passing by value: `TyCtxt<'_>`
[01:08:32] error: passing `Ty<'_>` by reference
[01:08:32]   --> /checkout/src/test/ui-fulldeps/internal-lints/pass_ty_by_ref.rs:26:17
[01:08:32]    |
[01:08:32]    |
[01:08:32] LL |         ty_ref: &Ty<'_>, //~ ERROR passing `Ty<'_>` by reference
[01:08:32]    |                 ^^^^^^^ help: try passing by value: `Ty<'_>`
[01:08:32] error: passing `TyCtxt<'_>` by reference
[01:08:32]   --> /checkout/src/test/ui-fulldeps/internal-lints/pass_ty_by_ref.rs:28:22
[01:08:32]    |
[01:08:32]    |
[01:08:32] LL |         ty_ctxt_ref: &TyCtxt<'_>, //~ ERROR passing `TyCtxt<'_>` by reference
[01:08:32]    |                      ^^^^^^^^^^^ help: try passing by value: `TyCtxt<'_>`
[01:08:32] error: passing `Ty<'_>` by reference
[01:08:32]   --> /checkout/src/test/ui-fulldeps/internal-lints/pass_ty_by_ref.rs:31:41
[01:08:32]    |
[01:08:32]    |
[01:08:32] LL |     fn ty_multi_ref_in_trait(ty_multi: &&Ty<'_>, ty_ctxt_multi: &&&&TyCtxt<'_>);
[01:08:32]    |                                         ^^^^^^^ help: try passing by value: `Ty<'_>`
[01:08:32] error: passing `TyCtxt<'_>` by reference
[01:08:32]   --> /checkout/src/test/ui-fulldeps/internal-lints/pass_ty_by_ref.rs:31:68
[01:08:32]    |
[01:08:32]    |
[01:08:32] LL |     fn ty_multi_ref_in_trait(ty_multi: &&Ty<'_>, ty_ctxt_multi: &&&&TyCtxt<'_>);
[01:08:32]    |                                                                    ^^^^^^^^^^^ help: try passing by value: `TyCtxt<'_>`
[01:08:32] error: passing `Ty<'_>` by reference
[01:08:32]   --> /checkout/src/test/ui-fulldeps/internal-lints/pass_ty_by_ref.rs:53:17
[01:08:32]    |
[01:08:32]    |
[01:08:32] LL |         ty_ref: &Ty<'_>, //~ ERROR passing `Ty<'_>` by reference
[01:08:32]    |                 ^^^^^^^ help: try passing by value: `Ty<'_>`
[01:08:32] error: passing `TyCtxt<'_>` by reference
[01:08:32]   --> /checkout/src/test/ui-fulldeps/internal-lints/pass_ty_by_ref.rs:55:22
[01:08:32]    |
[01:08:32]    |
[01:08:32] LL |         ty_ctxt_ref: &TyCtxt<'_>, //~ ERROR passing `TyCtxt<'_>` by reference
[01:08:32]    |                      ^^^^^^^^^^^ help: try passing by value: `TyCtxt<'_>`
[01:08:32] error: passing `Ty<'_>` by reference
[01:08:32]   --> /checkout/src/test/ui-fulldeps/internal-lints/pass_ty_by_ref.rs:59:38
[01:08:32]    |
[01:08:32]    |
[01:08:32] LL |     fn ty_multi_ref_assoc(ty_multi: &&Ty<'_>, ty_ctxt_multi: &&&&TyCtxt<'_>) {}
[01:08:32]    |                                      ^^^^^^^ help: try passing by value: `Ty<'_>`
[01:08:32] error: passing `TyCtxt<'_>` by reference
[01:08:32]   --> /checkout/src/test/ui-fulldeps/internal-lints/pass_ty_by_ref.rs:59:65
[01:08:32]    |
[01:08:32]    |
[01:08:32] LL |     fn ty_multi_ref_assoc(ty_multi: &&Ty<'_>, ty_ctxt_multi: &&&&TyCtxt<'_>) {}
[01:08:32]    |                                                                 ^^^^^^^^^^^ help: try passing by value: `TyCtxt<'_>`
[01:08:32] error: aborting due to 12 previous errors
[01:08:32] 
[01:08:32] 
[01:08:32] ------------------------------------------
[01:08:32] ------------------------------------------
[01:08:32] 
[01:08:32] 
[01:08:32] ---- [ui] ui-fulldeps/internal-lints/qualified_ty_ty_ctxt.rs stdout ----
[01:08:32] diff of stderr:
[01:08:32] 
[01:08:32] 14   --> $DIR/qualified_ty_ty_ctxt.rs:27:16
[01:08:32] 15    |
[01:08:32] 16 LL |     ty_ctxt_q: ty::TyCtxt<'_>,
[01:08:32] -    |                ^^^^^^^^^^^^^^^^^^ help: try using it unqualified: `TyCtxt<'_>`
[01:08:32] +    |                ^^^^^^^^^^^^^^ help: try using it unqualified: `TyCtxt<'_>`
[01:08:32] 19 error: aborting due to 2 previous errors
[01:08:32] 20 
[01:08:32] 
[01:08:32] 
[01:08:32] 
[01:08:32] The actual stderr differed from the expected stderr.
[01:08:32] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui-fulldeps/internal-lints/qualified_ty_ty_ctxt/qualified_ty_ty_ctxt.stderr
[01:08:32] To update references, rerun the tests and pass the `--bless` flag
[01:08:32] To only update this specific test, also pass `--test-args internal-lints/qualified_ty_ty_ctxt.rs`
[01:08:32] error: 1 errors occurred comparing output.
[01:08:32] status: exit code: 1
[01:08:32] status: exit code: 1
[01:08:32] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui-fulldeps/internal-lints/qualified_ty_ty_ctxt.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-fulldeps/internal-lints/qualified_ty_ty_ctxt" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-Z" "unstable-options" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui-fulldeps/internal-lints/qualified_ty_ty_ctxt/auxiliary" "-A" "unused"
[01:08:32] ------------------------------------------
[01:08:32] 
[01:08:32] ------------------------------------------
[01:08:32] stderr:
[01:08:32] stderr:
[01:08:32] thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:521:22
[01:08:32] note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
[01:08:32] ------------------------------------------
[01:08:32] error: usage of qualified `ty::Ty<'_>`
[01:08:32]   --> /checkout/src/test/ui-fulldeps/internal-lints/qualified_ty_ty_ctxt.rs:25:11
[01:08:32]    |
[01:08:32] LL |     ty_q: ty::Ty<'_>, //~ ERROR usage of qualified `ty::Ty<'_>`
[01:08:32]    |           ^^^^^^^^^^ help: try using it unqualified: `Ty<'_>`
[01:08:32] note: lint level defined here
[01:08:32]   --> /checkout/src/test/ui-fulldeps/internal-lints/qualified_ty_ty_ctxt.rs:4:9
[01:08:32]    |
[01:08:32]    |
[01:08:32] LL | #![deny(usage_of_qualified_ty)]
[01:08:32] 
[01:08:32] error: usage of qualified `ty::TyCtxt<'_>`
[01:08:32]   --> /checkout/src/test/ui-fulldeps/internal-lints/qualified_ty_ty_ctxt.rs:27:16
[01:08:32]    |
[01:08:32]    |
[01:08:32] LL |     ty_ctxt_q: ty::TyCtxt<'_>, //~ ERROR usage of qualified `ty::TyCtxt<'_>`
[01:08:32]    |                ^^^^^^^^^^^^^^ help: try using it unqualified: `TyCtxt<'_>`
[01:08:32] error: aborting due to 2 previous errors
[01:08:32] 
[01:08:32] 
[01:08:32] ------------------------------------------
---
[01:08:32] test result: FAILED. 22 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out
[01:08:32] 
[01:08:32] 
[01:08:32] 
[01:08:32] 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-fulldeps" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui-fulldeps" "--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"
[01:08:32] 
[01:08:32] 
[01:08:32] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:08:32] Build completed unsuccessfully in 1:03:48

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)

@eddyb eddyb force-pushed the eddyb:begone-gcx-attempt-2 branch from efcb742 to b532515 Jun 14, 2019

@rust-highfive

This comment was marked as resolved.

Copy link
Collaborator

commented Jun 14, 2019

The job mingw-check 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:15b6a49c:start=1560474201958782050,finish=1560474204539132835,duration=2580350785
$ 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
$ export GCP_CACHE_BUCKET=rust-lang-ci-cache
$ export AWS_ACCESS_KEY_ID=AKIA46X5W6CZEJZ6XT55
---
[00:05:37]     Checking syntax_pos v0.0.0 (/checkout/src/libsyntax_pos)
[00:05:39]     Checking rustc_errors v0.0.0 (/checkout/src/librustc_errors)
[00:05:39]     Checking fmt_macros v0.0.0 (/checkout/src/libfmt_macros)
[00:06:31]     Checking syntax_ext v0.0.0 (/checkout/src/libsyntax_ext)
[00:06:36] error[E0496]: lifetime name `'tcx` shadows a lifetime name that is already in scope
[00:06:36]   --> src/librustc/ty/query/job.rs:78:27
[00:06:36]    |
[00:06:36] 65 | impl<'tcx> QueryJob<'tcx> {
[00:06:36]    |      ---- first declared here
[00:06:36] ...
[00:06:36] 78 |     pub(super) fn r#await<'tcx>(
[00:06:36]    |                           ^^^^ lifetime 'tcx already in scope
[00:06:37] error: aborting due to previous error
[00:06:37] 
[00:06:37] For more information about this error, try `rustc --explain E0496`.
[00:06:37] error: Could not compile `rustc`.
---
travis_time:end:1756ed13:start=1560474614970359914,finish=1560474614975954303,duration=5594389
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:0650cb08
$ 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:040f3eae
travis_time:start:040f3eae
$ 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:02aa63c0
$ 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)

@eddyb eddyb force-pushed the eddyb:begone-gcx-attempt-2 branch from b532515 to 94cfb14 Jun 14, 2019

@nikomatsakis nikomatsakis referenced this pull request Jun 14, 2019

Closed

Transition the compiler arenas #61838

4 of 4 tasks complete
@eddyb

This comment has been minimized.

Copy link
Member Author

commented Jun 14, 2019

Review has started, let's get the ball rolling: @bors treeclosed=500

@eddyb

This comment has been minimized.

Copy link
Member Author

commented Jun 14, 2019

@bors p=700 (oops, forgot to also set this)

@mark-i-m

This comment has been minimized.

Copy link
Contributor

commented Jun 14, 2019

@eddyb When this whole transition is over, could you please update the rustc-guide (or tell me how to)?

@eddyb eddyb force-pushed the eddyb:begone-gcx-attempt-2 branch from 94cfb14 to afc39bb Jun 14, 2019

@eddyb

This comment has been minimized.

Copy link
Member Author

commented Jun 14, 2019

@mark-i-m Definitely! Not sure if I can do it today, sadly. I guess I could open the PR now and someone cam merge it once this PR is merged.

@oli-obk Oops! There were two instances of that, probably a VSCode stale file during mass-replacement (those changes look like something I did on a different branch but they never made it into a PR).
I've force-pushed with them removed.

@oli-obk

This comment has been minimized.

Copy link
Contributor

commented Jun 14, 2019

@bors r+

@bors

This comment has been minimized.

Copy link
Contributor

commented Jun 14, 2019

📌 Commit afc39bb has been approved by oli-obk

@bors

This comment has been minimized.

Copy link
Contributor

commented Jun 14, 2019

⌛️ Testing commit afc39bb with merge 9606f6f...

bors added a commit that referenced this pull request Jun 14, 2019

Auto merge of #61817 - eddyb:begone-gcx-attempt-2, r=oli-obk
Unify all uses of 'gcx and 'tcx.

This is made possible by @Zoxc landing #57214 (see #57214 (comment) for the decision).

A bit of context for the approach: just like #61722, this is *not* how I originally intended to go about this, but @Zoxc and my own experimentation independently resulted in the same conclusion:
The interim alias `type TyCx<'tcx> = TyCtxt<'tcx, 'tcx>;` attempt required more work (adding `use`s), even only for handling the `TyCtxt<'tcx, 'tcx>` case and not the general `TyCtxt<'gcx, 'tcx>` one.

What this PR is based on is the realization that `'gcx` is a special-enough name that it can be replaced, without caring for context, with `'tcx`, and then repetitions of the name `'tcx` be compacted away.
After that, only a small number of error categories remained, each category easily dealt with with either more mass replacements (e.g. `TyCtxt<'tcx, '_>` -> `TyCtxt<'tcx>`) or by hand.

For the `rustfmt` commit, I used rust-lang/rustfmt#1324 (comment), and manually filtered out some noise, like in #61735 and #61722, and like the latter, there was also a weird bug to work around.
It should be reviewed separately, and dropped if unwanted (in this PR it's pretty significant).

cc @rust-lang/compiler r? @nikomatsakis
-> DepNode
where 'gcx: 'a + 'tcx,
where 'tcx: 'a,
'tcx: 'a

This comment has been minimized.

Copy link
@RalfJung

RalfJung Jun 14, 2019

Member

There's still some redundancy here, do you plan to clean up later?

This comment has been minimized.

Copy link
@oli-obk

oli-obk Jun 14, 2019

Contributor

there are a few others, they will often be detected by various lints that are still in the process of getting fixed so they have no false positives

This comment has been minimized.

Copy link
@eddyb

eddyb Jun 14, 2019

Author Member

Yeah (although everyone is free to try, there really isn't that much).
I only removed the cases where it was causing an error, I guess my mistake was matching on the exact number of spaces instead of \s+.

This comment has been minimized.

Copy link
@eddyb

eddyb Jun 14, 2019

Author Member

In general we should start removing lifetime bounds except in the rare cases when they're needed.

@ehuss ehuss referenced this pull request Jun 14, 2019

Merged

Update cargo #61771

bors added a commit to rust-lang/rust-clippy that referenced this pull request Jun 14, 2019

Auto merge of #4209 - lzutao:TyCtxt-lifetime, r=Manishearth
Fix wrong lifetime of TyCtxt

Rustup rust-lang/rust#61817

changelog: none
@bors

This comment has been minimized.

Copy link
Contributor

commented Jun 14, 2019

☀️ Test successful - checks-travis, status-appveyor
Approved by: oli-obk
Pushing 9606f6f to master...

@bors bors added the merged-by-bors label Jun 14, 2019

@bors bors merged commit afc39bb into rust-lang:master Jun 14, 2019

3 checks passed

Travis CI - Pull Request Build Passed
Details
homu Test successful
Details
pr Build #20190614.33 succeeded
Details
@rust-highfive

This comment has been minimized.

Copy link
Collaborator

commented Jun 14, 2019

📣 Toolstate changed by #61817!

Tested on commit 9606f6f.
Direct link to PR: #61817

💔 clippy-driver on windows: test-pass → build-fail (cc @Manishearth @llogiq @mcarton @oli-obk @phansch, @rust-lang/infra).
💔 clippy-driver on linux: test-pass → build-fail (cc @Manishearth @llogiq @mcarton @oli-obk @phansch, @rust-lang/infra).
💔 miri on windows: test-pass → build-fail (cc @oli-obk @RalfJung @eddyb, @rust-lang/infra).
💔 miri on linux: test-pass → build-fail (cc @oli-obk @RalfJung @eddyb, @rust-lang/infra).
💔 rls on linux: test-pass → test-fail (cc @Xanewok, @rust-lang/infra).

rust-highfive added a commit to rust-lang-nursery/rust-toolstate that referenced this pull request Jun 14, 2019

📣 Toolstate changed by rust-lang/rust#61817!
Tested on commit rust-lang/rust@9606f6f.
Direct link to PR: <rust-lang/rust#61817>

💔 clippy-driver on windows: test-pass → build-fail (cc @Manishearth @llogiq @mcarton @oli-obk @phansch, @rust-lang/infra).
💔 clippy-driver on linux: test-pass → build-fail (cc @Manishearth @llogiq @mcarton @oli-obk @phansch, @rust-lang/infra).
💔 miri on windows: test-pass → build-fail (cc @oli-obk @RalfJung @eddyb, @rust-lang/infra).
💔 miri on linux: test-pass → build-fail (cc @oli-obk @RalfJung @eddyb, @rust-lang/infra).
💔 rls on linux: test-pass → test-fail (cc @Xanewok, @rust-lang/infra).

@eddyb eddyb deleted the eddyb:begone-gcx-attempt-2 branch Jun 14, 2019

@matthewjasper

This comment has been minimized.

Copy link
Contributor

commented Jun 14, 2019

@bors treeclosed-

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.