@@ -78,5 +78,71 @@ note: try using the same sequence of generic parameters as the struct definition
78
78
LL | pub struct WithLifetime<'a, T>(&'a (), T);
79
79
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
80
80
81
- error: aborting due to 5 previous errors
81
+ warning: field `0` is never read
82
+ --> $DIR/suspicious-impls-lint.rs:13:33
83
+ |
84
+ LL | struct ContainsNonSendDirect<T>(*const T);
85
+ | --------------------- ^^^^^^^^
86
+ | |
87
+ | field in this struct
88
+ |
89
+ = note: `#[warn(unused_tuple_struct_fields)]` on by default
90
+ help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
91
+ |
92
+ LL | struct ContainsNonSendDirect<T>(());
93
+ | ~~
94
+
95
+ warning: field `0` is never read
96
+ --> $DIR/suspicious-impls-lint.rs:16:23
97
+ |
98
+ LL | struct ContainsPtr<T>(*const T);
99
+ | ----------- ^^^^^^^^
100
+ | |
101
+ | field in this struct
102
+ |
103
+ help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
104
+ |
105
+ LL | struct ContainsPtr<T>(());
106
+ | ~~
107
+
108
+ warning: field `0` is never read
109
+ --> $DIR/suspicious-impls-lint.rs:17:35
110
+ |
111
+ LL | struct ContainsIndirectNonSend<T>(ContainsPtr<T>);
112
+ | ----------------------- ^^^^^^^^^^^^^^
113
+ | |
114
+ | field in this struct
115
+ |
116
+ help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
117
+ |
118
+ LL | struct ContainsIndirectNonSend<T>(());
119
+ | ~~
120
+
121
+ warning: field `0` is never read
122
+ --> $DIR/suspicious-impls-lint.rs:20:23
123
+ |
124
+ LL | struct ContainsVec<T>(Vec<T>);
125
+ | ----------- ^^^^^^
126
+ | |
127
+ | field in this struct
128
+ |
129
+ help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
130
+ |
131
+ LL | struct ContainsVec<T>(());
132
+ | ~~
133
+
134
+ warning: field `0` is never read
135
+ --> $DIR/suspicious-impls-lint.rs:44:32
136
+ |
137
+ LL | pub struct WithLifetime<'a, T>(&'a (), T);
138
+ | ------------ ^^^^^^
139
+ | |
140
+ | field in this struct
141
+ |
142
+ help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
143
+ |
144
+ LL | pub struct WithLifetime<'a, T>((), T);
145
+ | ~~
146
+
147
+ error: aborting due to 5 previous errors; 5 warnings emitted
82
148
0 commit comments