]> git.lizzy.rs Git - rust.git/commit
Auto merge of #61817 - eddyb:begone-gcx-attempt-2, r=oli-obk
authorbors <bors@rust-lang.org>
Fri, 14 Jun 2019 16:20:35 +0000 (16:20 +0000)
committerbors <bors@rust-lang.org>
Fri, 14 Jun 2019 16:20:35 +0000 (16:20 +0000)
commit9606f6fa64926a84d82e3c62dbdc57f5c10f756d
tree3924fbb3a1d240971e05cd150d387462e4201408
parentfc550d4295a654f9e7c621d957d81fbf1426c70b
parentafc39bbf2447844569e872468f9440d430b81a46
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 https://github.com/rust-lang/rust/pull/57214#issuecomment-465036053 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 https://github.com/rust-lang/rustfmt/issues/1324#issuecomment-482109952, 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
src/librustc/hir/lowering.rs
src/librustc_typeck/check/mod.rs