Merge unused_tuple_struct_fields into dead_code#118297
Conversation
This comment has been minimized.
This comment has been minimized.
876ee9f to
048aa9d
Compare
This comment has been minimized.
This comment has been minimized.
048aa9d to
d254a5f
Compare
|
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt Some changes occurred in src/librustdoc/clean/types.rs cc @camelid |
|
I'd happily take a PR that proactively fixes all of the compiler warnings. Most of them can just be removed, except for the |
|
Yeah, my plan is to find all of the current issues and submit it as a separate PR, it’s just easier to find it here first. I was attempting to do that without causing undue noise (thanks rustbot 👀). |
0f05b27 to
b1f9900
Compare
This comment has been minimized.
This comment has been minimized.
|
Regarding the T-lang nomination, one of the open questions here is whether this should be part of the The motivation for making this part of warning: field `a` is never read
--> src/lib.rs:1:12
|
1 | struct A { a: () }
| - ^
| |
| field in this struct
|
= note: `#[warn(dead_code)]` on by defaultOn 2022-01-25, T-lang requested this lint be separated from However, after that decision, on 2022-01-26, @pnkfelix suggested a change to the lint that would allow people to resolve the warning without changing field indices:
This change was implemented and is suggested as part of the error message, e.g.: error: field is never read: `1`
--> $DIR/tuple-struct-field.rs:6:21
|
LL | struct Wrapper(i32, [u8; LEN], String);
| ^^^^^^^^^
|
help: change the field to unit type to suppress this warning while preserving the field numbering
|
LL | struct Wrapper(i32, (), String);
| In discussion in T-compiler in Zulip, the feeling seemed to be that this should be part of |
|
☔ The latest upstream changes (presumably #118370) made this pull request unmergeable. Please resolve the merge conflicts. |
Opened in #118382 |
|
@rustbot labels -I-lang-nominated This was discussed in the T-lang triage call today, and the consensus was that it's OK for this to become part of the |
b1f9900 to
0ee2b06
Compare
unused_tuple_struct_fields into dead_code
|
r? compiler |
This comment has been minimized.
This comment has been minimized.
WaffleLapkin
left a comment
There was a problem hiding this comment.
Just a bit of a nitpick. Feel free to change labels to waiting on review once CI is green
| if is_pos { | ||
| is_positional = true; | ||
| } |
There was a problem hiding this comment.
Isn't this just is_positional = is_pos or is_positional |= is_pos?
There was a problem hiding this comment.
Also can't we just do a single check is variant is tuple-like or not, instead of trying to move this out of the loop?..
There was a problem hiding this comment.
Isn't this [...]
is_positional |= is_pos?
Yeah, I thought about that but wanted to make the diff smaller / easier to see how it changed. Happy to update to this.
do a single check is variant is tuple-like or not
That seems plausible, but I don't know my way around the compiler enough to do so. Got any hints?
instead of trying to move this out of the loop
I thought you were suggesting that we should move it out of the loop — I must not understand what you mean.
There was a problem hiding this comment.
I thought you were suggesting that we should move it out of the loop — I must not understand what you mean.
Right, I see why this is confusing.
"trying to move this out of the loop"
this refers to the is_pos which is moved into is_positional, which is outside of the loop.
This implicitly upgrades the lint from
allowtowarnand places it into theunusedlint group.Discussion on Zulip