Uh oh!
There was an error while loading. Please reload this page.
Unify all uses of 'gcx and 'tcx. - #61817
Conversation
Centril
commented
Jun 13, 2019
@bors treeclosed=500 |
Centril
commented
Jun 13, 2019
@bors treeclosed- That was a bit premature 🤣 |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
eddyb
commented
Jun 14, 2019
Review has started, let's get the ball rolling: @bors treeclosed=500 |
eddyb
commented
Jun 14, 2019
@bors p=700 (oops, forgot to also set this) |
mark-i-m
commented
Jun 14, 2019
@eddyb When this whole transition is over, could you please update the rustc-guide (or tell me how to)? |
eddyb
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). |
oli-obk
commented
Jun 14, 2019
@bors r+ |
bors
commented
Jun 14, 2019
📌 Commit afc39bb has been approved by |
bors
commented
Jun 14, 2019
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 |
There was a problem hiding this comment.
There's still some redundancy here, do you plan to clean up later?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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+.
There was a problem hiding this comment.
In general we should start removing lifetime bounds except in the rare cases when they're needed.
Fix wrong lifetime of TyCtxt Rustup rust-lang/rust#61817 changelog: none
bors
commented
Jun 14, 2019
☀️ Test successful - checks-travis, status-appveyor |
rust-highfive
commented
Jun 14, 2019
📣 Toolstate changed by #61817! Tested on commit 9606f6f. 💔 clippy-driver on windows: test-pass → build-fail (cc @Manishearth@llogiq@mcarton@oli-obk@phansch, @rust-lang/infra). |
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).
matthewjasper
commented
Jun 14, 2019
@bors treeclosed- |
Fix wrong lifetime of TyCtxt Rustup rust-lang/rust#61817 changelog: none
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 (addinguses), even only for handling theTyCtxt<'tcx, 'tcx>case and not the generalTyCtxt<'gcx, 'tcx>one.What this PR is based on is the realization that
'gcxis a special-enough name that it can be replaced, without caring for context, with'tcx, and then repetitions of the name'tcxbe 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
rustfmtcommit, 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