@@ -76,43 +76,43 @@ LL | #[must_use]
7676 | ^^^^^^^^^^^
7777
7878error: `#[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
8080 |
8181LL | #[must_use]
8282 | ^^^^^^^^^^^
8383
8484error: `#[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
8686 |
8787LL | #[must_use]
8888 | ^^^^^^^^^^^
8989
9090error: `#[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
9292 |
9393LL | #[must_use]
9494 | ^^^^^^^^^^^
9595
9696error: `#[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
9898 |
9999LL | let x = #[must_use]
100100 | ^^^^^^^^^^^
101101
102102error: `#[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
104104 |
105105LL | #[must_use]
106106 | ^^^^^^^^^^^
107107
108108error: `#[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
110110 |
111111LL | let s = PatternField { #[must_use] foo: 123 };
112112 | ^^^^^^^^^^^
113113
114114error: `#[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
116116 |
117117LL | let PatternField { #[must_use] foo } = s;
118118 | ^^^^^^^^^^^
@@ -129,14 +129,20 @@ error: `#[must_use]` has no effect when applied to an associated type
129129LL | #[must_use]
130130 | ^^^^^^^^^^^
131131
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+
132138error: `#[must_use]` has no effect when applied to a foreign static item
133139 --> $DIR/unused_attributes-must_use.rs:50:5
134140 |
135141LL | #[must_use]
136142 | ^^^^^^^^^^^
137143
138144error: unused `X` that must be used
139- --> $DIR/unused_attributes-must_use.rs:103 :5
145+ --> $DIR/unused_attributes-must_use.rs:108 :5
140146 |
141147LL | X;
142148 | ^
@@ -152,7 +158,7 @@ LL | let _ = X;
152158 | +++++++
153159
154160error: unused `Y` that must be used
155- --> $DIR/unused_attributes-must_use.rs:104 :5
161+ --> $DIR/unused_attributes-must_use.rs:109 :5
156162 |
157163LL | Y::Z;
158164 | ^^^^
@@ -163,7 +169,7 @@ LL | let _ = Y::Z;
163169 | +++++++
164170
165171error: unused `U` that must be used
166- --> $DIR/unused_attributes-must_use.rs:105 :5
172+ --> $DIR/unused_attributes-must_use.rs:110 :5
167173 |
168174LL | U { unit: () };
169175 | ^^^^^^^^^^^^^^
@@ -174,7 +180,7 @@ LL | let _ = U { unit: () };
174180 | +++++++
175181
176182error: 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
178184 |
179185LL | U::method();
180186 | ^^^^^^^^^^^
@@ -185,7 +191,7 @@ LL | let _ = U::method();
185191 | +++++++
186192
187193error: 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
189195 |
190196LL | foo();
191197 | ^^^^^
@@ -196,7 +202,7 @@ LL | let _ = foo();
196202 | +++++++
197203
198204error: 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
200206 |
201207LL | foreign_foo();
202208 | ^^^^^^^^^^^^^
@@ -207,7 +213,7 @@ LL | let _ = foreign_foo();
207213 | +++++++
208214
209215error: 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
211217 |
212218LL | ().get_four();
213219 | ^^^^^^^^^^^^^
@@ -217,5 +223,5 @@ help: use `let _ = ...` to ignore the resulting value
217223LL | let _ = ().get_four();
218224 | +++++++
219225
220- error: aborting due to 28 previous errors
226+ error: aborting due to 29 previous errors
221227
0 commit comments