Skip to content

Suggest removing unused tuple fields if they are the last fields #124580

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Jun 19, 2024

Conversation

gurry
Copy link
Contributor

@gurry gurry commented May 1, 2024

Fixes #124556

We now check if dead/unused fields are the last fields of the tuple and suggest their removal instead of suggesting them to be changed to ().

@rustbot
Copy link
Collaborator

rustbot commented May 1, 2024

r? @wesleywiser

rustbot has assigned @wesleywiser.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels May 1, 2024
@gurry gurry force-pushed the 124556-suggest-remove-tuple-field branch from a70dfad to 012a458 Compare May 13, 2024 12:14
@gurry
Copy link
Contributor Author

gurry commented May 19, 2024

@wesleywiser please review

1 similar comment
@gurry
Copy link
Contributor Author

gurry commented Jun 3, 2024

@wesleywiser please review

@compiler-errors
Copy link
Member

@gurry: Please use the r? compiler syntax to re-roll a reviewer if the reviewer hasn't reviewed your PR after a few weeks. It's easier than pinging the reviewer.

@compiler-errors
Copy link
Member

r? compiler

@rustbot rustbot assigned lcnr and unassigned wesleywiser Jun 18, 2024
@gurry
Copy link
Contributor Author

gurry commented Jun 18, 2024

@gurry: Please use the r? compiler syntax to re-roll a reviewer if the reviewer hasn't reviewed your PR after a few weeks. It's easier than pinging the reviewer.

Thanks @compiler-errors. That's a great tip 👍. Will keep it in mind.

@jackh726
Copy link
Member

r? @jackh726

This seems good to me. Sorry about the review delay.

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Jun 18, 2024

📌 Commit 012a458 has been approved by jackh726

It is now in the queue for this repository.

@bors bors 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 Jun 18, 2024
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Jun 18, 2024
…field, r=jackh726

Suggest removing unused tuple fields if they are the last fields

Fixes rust-lang#124556

We now check if dead/unused fields are the last fields of the tuple and suggest their removal instead of suggesting them to be changed to `()`.
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Jun 18, 2024
…field, r=jackh726

Suggest removing unused tuple fields if they are the last fields

Fixes rust-lang#124556

We now check if dead/unused fields are the last fields of the tuple and suggest their removal instead of suggesting them to be changed to `()`.
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 18, 2024
…llaumeGomez

Rollup of 9 pull requests

Successful merges:

 - rust-lang#123782 (Test that opaque types can't have themselves as a hidden type with incompatible lifetimes)
 - rust-lang#124580 (Suggest removing unused tuple fields if they are the last fields)
 - rust-lang#125852 (improve tip for inaccessible traits)
 - rust-lang#126422 (Suggest using a standalone doctest for non-local impl defs)
 - rust-lang#126427 (Rewrite `intrinsic-unreachable`, `sepcomp-cci-copies`, `sepcomp-inlining` and `sepcomp-separate` `run-make` tests to rmake.rs)
 - rust-lang#126493 (safe transmute: support non-ZST, variantful, uninhabited enums)
 - rust-lang#126572 (override user defined channel when using precompiled rustc)
 - rust-lang#126615 (Add `rustc-ice*` to `.gitignore`)
 - rust-lang#126632 (Replace `move||` with `move ||`)

Failed merges:

 - rust-lang#126558 (hir_typeck: be more conservative in making "note caller chooses ty param" note)

r? `@ghost`
`@rustbot` modify labels: rollup
jieyouxu added a commit to jieyouxu/rust that referenced this pull request Jun 19, 2024
…field, r=jackh726

Suggest removing unused tuple fields if they are the last fields

Fixes rust-lang#124556

We now check if dead/unused fields are the last fields of the tuple and suggest their removal instead of suggesting them to be changed to `()`.
@gurry
Copy link
Contributor Author

gurry commented Jun 19, 2024

r? @jackh726

This seems good to me. Sorry about the review delay.

@bors r+ rollup

Thanks. No worries :)

fmease added a commit to fmease/rust that referenced this pull request Jun 19, 2024
…field, r=jackh726

Suggest removing unused tuple fields if they are the last fields

Fixes rust-lang#124556

We now check if dead/unused fields are the last fields of the tuple and suggest their removal instead of suggesting them to be changed to `()`.
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 19, 2024
Rollup of 7 pull requests

Successful merges:

 - rust-lang#123782 (Test that opaque types can't have themselves as a hidden type with incompatible lifetimes)
 - rust-lang#124580 (Suggest removing unused tuple fields if they are the last fields)
 - rust-lang#125787 (Migrate `bin-emit-no-symbols` `run-make` test to `rmake`)
 - rust-lang#126553 (match lowering: expand or-candidates mixed with candidates above)
 - rust-lang#126594 (Make async drop code more consistent with regular drop code)
 - rust-lang#126654 (Make pretty printing for `f16` and `f128` consistent)
 - rust-lang#126656 (rustc_type_ir: Omit some struct fields from Debug output)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 96144c9 into rust-lang:master Jun 19, 2024
6 checks passed
@rustbot rustbot added this to the 1.81.0 milestone Jun 19, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Jun 19, 2024
Rollup merge of rust-lang#124580 - gurry:124556-suggest-remove-tuple-field, r=jackh726

Suggest removing unused tuple fields if they are the last fields

Fixes rust-lang#124556

We now check if dead/unused fields are the last fields of the tuple and suggest their removal instead of suggesting them to be changed to `()`.
@gurry gurry deleted the 124556-suggest-remove-tuple-field branch June 20, 2024 06:48
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

unused tuple field warning should suggest deleting field if it's the last field
8 participants