Skip to content

Lifetime variance fixes for clippy - #97289

Merged
bors merged 1 commit into
rust-lang:masterfrom
compiler-errors:tcxify-clippy
May 24, 2022
Merged

Lifetime variance fixes for clippy#97289
bors merged 1 commit into
rust-lang:masterfrom
compiler-errors:tcxify-clippy

Conversation

@compiler-errors

Copy link
Copy Markdown
Contributor

#97287 migrates rustc to a Ty type that is invariant over its lifetime 'tcx, so I need to fix a bunch of places that assume that Ty<'a> and Ty<'b> can be shortened to some common lifetime.

This is doable, since everything is already 'tcx, so all this PR does is be a bit more explicit that elided lifetimes are actually 'tcx.

Split out from #97287 so the clippy team can review independently.

@rust-highfive

Copy link
Copy Markdown
Contributor

Some changes occurred in src/tools/clippy.

cc @rust-lang/clippy

@rust-highfive

Copy link
Copy Markdown
Contributor

r? @Mark-Simulacrum

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 22, 2022
@rust-log-analyzer

This comment has been minimized.

@compiler-errors

compiler-errors commented May 22, 2022

Copy link
Copy Markdown
ContributorAuthor

that's an embarrassing copy mistake

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this was a search and replace gone wrong?

@Mark-Simulacrum

Copy link
Copy Markdown
Member

I commented on one case but it looks like there are a few more at least where 'a' is replaced with _tcx in comments etc

@Mark-SimulacrumMark-Simulacrum added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 23, 2022
@compiler-errors
compiler-errorsforce-pushed the tcxify-clippy branch 2 times, most recently from 2ae5732 to 8983f54CompareMay 23, 2022 15:56
@compiler-errors

Copy link
Copy Markdown
ContributorAuthor

Don't know how every a turned into _tcx in exactly one clippy file, but that's fixed. The changes are a lot shorter now too. Sorry for the mistakes.

@rustbot ready

@rustbotrustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels May 23, 2022
Comment threadsrc/tools/clippy/clippy_lints/src/dereference.rs Outdated
@Mark-Simulacrum

Copy link
Copy Markdown
Member

r=me modulo comment (either way)

@compiler-errors

Copy link
Copy Markdown
ContributorAuthor

@bors r=Mark-Simulacrum

@bors

bors commented May 23, 2022

Copy link
Copy Markdown
Collaborator

📌 Commit 215decd has been approved by Mark-Simulacrum

@borsbors 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 May 23, 2022
@JohnTitorJohnTitor mentioned this pull request May 24, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request May 24, 2022
Rollup of 5 pull requests
Successful merges:
- rust-lang#97240 (Typo suggestion for a variable with a name similar to struct fields)
- rust-lang#97289 (Lifetime variance fixes for clippy)
- rust-lang#97290 (Turn on `fast_submodules` unconditionally)
- rust-lang#97336 (typo)
- rust-lang#97337 (Fix stabilization version of `Ipv6Addr::to_ipv4_mapped`)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
@bors
bors merged commit 3157e1f into rust-lang:masterMay 24, 2022
@rustbotrustbot added this to the 1.63.0 milestone May 24, 2022
flip1995 pushed a commit to flip1995/rust that referenced this pull request Jun 4, 2022
…rk-Simulacrum
Lifetime variance fixes for clippy
rust-lang#97287 migrates rustc to a `Ty` type that is invariant over its lifetime `'tcx`, so I need to fix a bunch of places that assume that `Ty<'a>` and `Ty<'b>` can be shortened to some common lifetime.
This is doable, since everything is already `'tcx`, so all this PR does is be a bit more explicit that elided lifetimes are actually `'tcx`.
Split out from rust-lang#97287 so the clippy team can review independently.
@compiler-errors
compiler-errors deleted the tcxify-clippy branch August 11, 2023 20:20
@fmeasefmease added the T-clippy Relevant to the Clippy team. label Oct 8, 2025
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-clippyRelevant to the Clippy team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants

@compiler-errors@rust-highfive@rust-log-analyzer@Mark-Simulacrum@bors@apiraino@fmease@rustbot