@@ -213,6 +213,9 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
213
213
Attribute :: Parsed ( AttributeKind :: Used { span : attr_span, .. } ) => {
214
214
self . check_used ( * attr_span, target, span) ;
215
215
}
216
+ & Attribute :: Parsed ( AttributeKind :: PassByValue ( attr_span) ) => {
217
+ self . check_pass_by_value ( attr_span, span, target)
218
+ }
216
219
Attribute :: Unparsed ( attr_item) => {
217
220
style = Some ( attr_item. style ) ;
218
221
match attr. path ( ) . as_slice ( ) {
@@ -275,7 +278,6 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
275
278
| [ sym:: const_trait, ..] => self . check_must_be_applied_to_trait ( attr. span ( ) , span, target) ,
276
279
[ sym:: collapse_debuginfo, ..] => self . check_collapse_debuginfo ( attr, span, target) ,
277
280
[ sym:: must_not_suspend, ..] => self . check_must_not_suspend ( attr, span, target) ,
278
- [ sym:: rustc_pass_by_value, ..] => self . check_pass_by_value ( attr, span, target) ,
279
281
[ sym:: rustc_allow_incoherent_impl, ..] => {
280
282
self . check_allow_incoherent_impl ( attr, span, target)
281
283
}
@@ -1438,11 +1440,11 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
1438
1440
}
1439
1441
1440
1442
/// Warns against some misuses of `#[pass_by_value]`
1441
- fn check_pass_by_value ( & self , attr : & Attribute , span : Span , target : Target ) {
1443
+ fn check_pass_by_value ( & self , attr_span : Span , span : Span , target : Target ) {
1442
1444
match target {
1443
1445
Target :: Struct | Target :: Enum | Target :: TyAlias => { }
1444
1446
_ => {
1445
- self . dcx ( ) . emit_err ( errors:: PassByValue { attr_span : attr . span ( ) , span } ) ;
1447
+ self . dcx ( ) . emit_err ( errors:: PassByValue { attr_span, span } ) ;
1446
1448
}
1447
1449
}
1448
1450
}
0 commit comments