Commit 9bbbf60
committed
Auto merge of rust-lang#95977 - FabianWolff:issue-92790-dead-tuple, r=estebank
Warn about dead tuple struct fields
Continuation of rust-lang#92972. Fixes rust-lang#92790.
The language team has already commented on this in rust-lang#92972 (comment); 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 (rust-lang#92972 (comment)), 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`File tree
168 files changed
+451
-246
lines changed- compiler
- rustc_apfloat/src
- rustc_lint_defs/src
- rustc_passes/src
- src
- test
- codegen-units/item-collection
- run-make-fulldeps/issues-41478-43796
- ui
- allocator
- array-slice-vec
- associated-consts
- associated-type-bounds
- associated-types
- async-await
- auto-traits
- bench
- binding
- builtin-superkinds
- chalkify
- closures/2229_closure_analysis/migrations
- codegen
- coercion
- const-generics
- generic_const_exprs
- consts
- const_in_pattern
- deriving
- dropck
- drop
- enum-discriminant
- generator
- generics
- impl-trait
- issues
- layout
- lint/dead-code
- macros
- methods
- mir
- packed
- parser/issues
- recursion
- rfc-1445-restrict-constants-in-patterns
- rfc-2632-const-trait-impl
- rfcs/rfc-2151-raw-identifiers
- specialization
- stdlib-unit-tests
- structs-enums
- traits
- negative-impls
- object
- type-alias-enum-variants
- unboxed-closures
- unsized-locals
- unsized
- tools/clippy/tests/ui
- borrow_interior_mutable_const/auxiliary
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
168 files changed
+451
-246
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
630 | 630 | | |
631 | 631 | | |
632 | 632 | | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
633 | 659 | | |
634 | 660 | | |
635 | 661 | | |
| |||
3281 | 3307 | | |
3282 | 3308 | | |
3283 | 3309 | | |
| 3310 | + | |
3284 | 3311 | | |
3285 | 3312 | | |
3286 | 3313 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| |||
2020 | 2020 | | |
2021 | 2021 | | |
2022 | 2022 | | |
2023 | | - | |
2024 | | - | |
2025 | | - | |
2026 | | - | |
2027 | | - | |
2028 | | - | |
| 2023 | + | |
2029 | 2024 | | |
2030 | 2025 | | |
2031 | 2026 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| |||
220 | 221 | | |
221 | 222 | | |
222 | 223 | | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
223 | 250 | | |
224 | 251 | | |
225 | 252 | | |
| |||
274 | 301 | | |
275 | 302 | | |
276 | 303 | | |
| 304 | + | |
277 | 305 | | |
| 306 | + | |
278 | 307 | | |
279 | 308 | | |
280 | 309 | | |
281 | 310 | | |
282 | 311 | | |
| 312 | + | |
283 | 313 | | |
284 | 314 | | |
285 | 315 | | |
| |||
315 | 345 | | |
316 | 346 | | |
317 | 347 | | |
| 348 | + | |
318 | 349 | | |
319 | 350 | | |
320 | 351 | | |
| |||
347 | 378 | | |
348 | 379 | | |
349 | 380 | | |
| 381 | + | |
350 | 382 | | |
351 | 383 | | |
352 | | - | |
| 384 | + | |
353 | 385 | | |
354 | 386 | | |
355 | 387 | | |
| |||
408 | 440 | | |
409 | 441 | | |
410 | 442 | | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
411 | 447 | | |
412 | 448 | | |
413 | 449 | | |
| |||
440 | 476 | | |
441 | 477 | | |
442 | 478 | | |
443 | | - | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
444 | 484 | | |
445 | 485 | | |
446 | 486 | | |
| |||
470 | 510 | | |
471 | 511 | | |
472 | 512 | | |
473 | | - | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
474 | 518 | | |
475 | 519 | | |
476 | 520 | | |
| |||
623 | 667 | | |
624 | 668 | | |
625 | 669 | | |
| 670 | + | |
626 | 671 | | |
627 | 672 | | |
628 | 673 | | |
| |||
644 | 689 | | |
645 | 690 | | |
646 | 691 | | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
647 | 697 | | |
648 | | - | |
| 698 | + | |
649 | 699 | | |
650 | | - | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
651 | 705 | | |
652 | 706 | | |
653 | | - | |
654 | | - | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
655 | 714 | | |
656 | | - | |
657 | | - | |
| 715 | + | |
658 | 716 | | |
659 | 717 | | |
660 | 718 | | |
661 | 719 | | |
662 | 720 | | |
663 | 721 | | |
664 | 722 | | |
| 723 | + | |
665 | 724 | | |
666 | 725 | | |
667 | 726 | | |
668 | 727 | | |
669 | 728 | | |
670 | 729 | | |
671 | 730 | | |
672 | | - | |
| 731 | + | |
673 | 732 | | |
674 | 733 | | |
675 | 734 | | |
| |||
678 | 737 | | |
679 | 738 | | |
680 | 739 | | |
681 | | - | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
682 | 745 | | |
683 | | - | |
| 746 | + | |
684 | 747 | | |
685 | 748 | | |
686 | 749 | | |
| |||
702 | 765 | | |
703 | 766 | | |
704 | 767 | | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
705 | 783 | | |
706 | 784 | | |
707 | 785 | | |
| |||
743 | 821 | | |
744 | 822 | | |
745 | 823 | | |
| 824 | + | |
746 | 825 | | |
747 | 826 | | |
748 | 827 | | |
| |||
758 | 837 | | |
759 | 838 | | |
760 | 839 | | |
| 840 | + | |
761 | 841 | | |
762 | 842 | | |
763 | 843 | | |
764 | 844 | | |
765 | 845 | | |
766 | | - | |
| 846 | + | |
767 | 847 | | |
768 | 848 | | |
769 | 849 | | |
| |||
829 | 909 | | |
830 | 910 | | |
831 | 911 | | |
| 912 | + | |
832 | 913 | | |
833 | 914 | | |
834 | 915 | | |
835 | 916 | | |
836 | 917 | | |
837 | 918 | | |
838 | | - | |
839 | | - | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
840 | 933 | | |
841 | 934 | | |
842 | 935 | | |
843 | 936 | | |
844 | 937 | | |
845 | 938 | | |
846 | | - | |
| 939 | + | |
847 | 940 | | |
848 | 941 | | |
849 | | - | |
| 942 | + | |
850 | 943 | | |
851 | 944 | | |
852 | 945 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| |||
0 commit comments