-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
unused tuple field warning should suggest deleting field if it's the last field #124556
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Comments
joshtriplett
added
A-diagnostics
Area: Messages for errors, warnings, and lints
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
labels
Apr 30, 2024
@rustbot claim |
GuillaumeGomez
added a commit
to GuillaumeGomez/rust
that referenced
this issue
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 issue
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 `()`.
jieyouxu
added a commit
to jieyouxu/rust
that referenced
this issue
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 `()`.
fmease
added a commit
to fmease/rust
that referenced
this issue
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 `()`.
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this issue
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 `()`.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Code
Current output
Desired output
Rationale and extra context
The idea of changing a field to unit type to preserve field numbering makes sense for fields in the middle of a tuple. However, if the unused field is at the end, or it's the only field, then deleting it won't affect field numbering of any other field.
Other cases
No response
Rust Version
Anything else?
No response
The text was updated successfully, but these errors were encountered: