@@ -76,43 +76,43 @@ LL | #[must_use]
76
76
| ^^^^^^^^^^^
77
77
78
78
error: `#[must_use]` has no effect when applied to a trait alias
79
- --> $DIR/unused_attributes-must_use.rs:84 :1
79
+ --> $DIR/unused_attributes-must_use.rs:89 :1
80
80
|
81
81
LL | #[must_use]
82
82
| ^^^^^^^^^^^
83
83
84
84
error: `#[must_use]` has no effect when applied to a macro def
85
- --> $DIR/unused_attributes-must_use.rs:87 :1
85
+ --> $DIR/unused_attributes-must_use.rs:92 :1
86
86
|
87
87
LL | #[must_use]
88
88
| ^^^^^^^^^^^
89
89
90
90
error: `#[must_use]` has no effect when applied to a statement
91
- --> $DIR/unused_attributes-must_use.rs:95 :5
91
+ --> $DIR/unused_attributes-must_use.rs:100 :5
92
92
|
93
93
LL | #[must_use]
94
94
| ^^^^^^^^^^^
95
95
96
96
error: `#[must_use]` has no effect when applied to a closure
97
- --> $DIR/unused_attributes-must_use.rs:99 :13
97
+ --> $DIR/unused_attributes-must_use.rs:104 :13
98
98
|
99
99
LL | let x = #[must_use]
100
100
| ^^^^^^^^^^^
101
101
102
102
error: `#[must_use]` has no effect when applied to an match arm
103
- --> $DIR/unused_attributes-must_use.rs:121 :9
103
+ --> $DIR/unused_attributes-must_use.rs:126 :9
104
104
|
105
105
LL | #[must_use]
106
106
| ^^^^^^^^^^^
107
107
108
108
error: `#[must_use]` has no effect when applied to a struct field
109
- --> $DIR/unused_attributes-must_use.rs:129 :28
109
+ --> $DIR/unused_attributes-must_use.rs:134 :28
110
110
|
111
111
LL | let s = PatternField { #[must_use] foo: 123 };
112
112
| ^^^^^^^^^^^
113
113
114
114
error: `#[must_use]` has no effect when applied to a pattern field
115
- --> $DIR/unused_attributes-must_use.rs:130 :24
115
+ --> $DIR/unused_attributes-must_use.rs:135 :24
116
116
|
117
117
LL | let PatternField { #[must_use] foo } = s;
118
118
| ^^^^^^^^^^^
@@ -129,14 +129,20 @@ error: `#[must_use]` has no effect when applied to an associated type
129
129
LL | #[must_use]
130
130
| ^^^^^^^^^^^
131
131
132
+ error: `#[must_use]` has no effect when applied to a provided trait method
133
+ --> $DIR/unused_attributes-must_use.rs:83:5
134
+ |
135
+ LL | #[must_use]
136
+ | ^^^^^^^^^^^
137
+
132
138
error: `#[must_use]` has no effect when applied to a foreign static item
133
139
--> $DIR/unused_attributes-must_use.rs:50:5
134
140
|
135
141
LL | #[must_use]
136
142
| ^^^^^^^^^^^
137
143
138
144
error: unused `X` that must be used
139
- --> $DIR/unused_attributes-must_use.rs:103 :5
145
+ --> $DIR/unused_attributes-must_use.rs:108 :5
140
146
|
141
147
LL | X;
142
148
| ^
@@ -152,7 +158,7 @@ LL | let _ = X;
152
158
| +++++++
153
159
154
160
error: unused `Y` that must be used
155
- --> $DIR/unused_attributes-must_use.rs:104 :5
161
+ --> $DIR/unused_attributes-must_use.rs:109 :5
156
162
|
157
163
LL | Y::Z;
158
164
| ^^^^
@@ -163,7 +169,7 @@ LL | let _ = Y::Z;
163
169
| +++++++
164
170
165
171
error: unused `U` that must be used
166
- --> $DIR/unused_attributes-must_use.rs:105 :5
172
+ --> $DIR/unused_attributes-must_use.rs:110 :5
167
173
|
168
174
LL | U { unit: () };
169
175
| ^^^^^^^^^^^^^^
@@ -174,7 +180,7 @@ LL | let _ = U { unit: () };
174
180
| +++++++
175
181
176
182
error: unused return value of `U::method` that must be used
177
- --> $DIR/unused_attributes-must_use.rs:106 :5
183
+ --> $DIR/unused_attributes-must_use.rs:111 :5
178
184
|
179
185
LL | U::method();
180
186
| ^^^^^^^^^^^
@@ -185,7 +191,7 @@ LL | let _ = U::method();
185
191
| +++++++
186
192
187
193
error: unused return value of `foo` that must be used
188
- --> $DIR/unused_attributes-must_use.rs:107 :5
194
+ --> $DIR/unused_attributes-must_use.rs:112 :5
189
195
|
190
196
LL | foo();
191
197
| ^^^^^
@@ -196,7 +202,7 @@ LL | let _ = foo();
196
202
| +++++++
197
203
198
204
error: unused return value of `foreign_foo` that must be used
199
- --> $DIR/unused_attributes-must_use.rs:110 :9
205
+ --> $DIR/unused_attributes-must_use.rs:115 :9
200
206
|
201
207
LL | foreign_foo();
202
208
| ^^^^^^^^^^^^^
@@ -207,7 +213,7 @@ LL | let _ = foreign_foo();
207
213
| +++++++
208
214
209
215
error: unused return value of `Use::get_four` that must be used
210
- --> $DIR/unused_attributes-must_use.rs:118 :5
216
+ --> $DIR/unused_attributes-must_use.rs:123 :5
211
217
|
212
218
LL | ().get_four();
213
219
| ^^^^^^^^^^^^^
@@ -217,5 +223,5 @@ help: use `let _ = ...` to ignore the resulting value
217
223
LL | let _ = ().get_four();
218
224
| +++++++
219
225
220
- error: aborting due to 28 previous errors
226
+ error: aborting due to 29 previous errors
221
227
0 commit comments