about summary refs log tree commit diff
path: root/compiler/rustc_privacy/src/errors.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-08-05 09:32:26 +0000
committerbors <bors@rust-lang.org>2022-08-05 09:32:26 +0000
commit9bbbf60b0442f1d56fc39f30274be77acc79164c (patch)
tree1ce993d5a0b8f327611f5d4ab57c11ec3bd3c9e6 /compiler/rustc_privacy/src/errors.rs
parentcdfd675a63090182fd1c5f2ff58d8eaa115da156 (diff)
parente3c7e04a4430942205872a8ed3c67531f22985bc (diff)
downloadrust-9bbbf60b0442f1d56fc39f30274be77acc79164c.tar.gz
rust-9bbbf60b0442f1d56fc39f30274be77acc79164c.zip
Auto merge of #95977 - FabianWolff:issue-92790-dead-tuple, r=estebank
Warn about dead tuple struct fields

Continuation of #92972. Fixes #92790.

The language team has already commented on this in https://github.com/rust-lang/rust/pull/92972#issuecomment-1021511970; I have incorporated their requests here. Specifically, there is now a new allow-by-default `unused_tuple_struct_fields` lint (name bikesheddable), and fields of unit type are ignored (https://github.com/rust-lang/rust/pull/92972#issuecomment-1021815408), so error messages look like this:
```
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);
   |                     ~~
```
r? `@joshtriplett`
Diffstat (limited to 'compiler/rustc_privacy/src/errors.rs')
0 files changed, 0 insertions, 0 deletions