@@ -221,6 +221,9 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
221
221
Attribute :: Parsed ( AttributeKind :: Used { span : attr_span, .. } ) => {
222
222
self . check_used ( * attr_span, target, span) ;
223
223
}
224
+ & Attribute :: Parsed ( AttributeKind :: PassByValue ( attr_span) ) => {
225
+ self . check_pass_by_value ( attr_span, span, target)
226
+ }
224
227
Attribute :: Unparsed ( attr_item) => {
225
228
style = Some ( attr_item. style ) ;
226
229
match attr. path ( ) . as_slice ( ) {
@@ -283,7 +286,6 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
283
286
| [ sym:: const_trait, ..] => self . check_must_be_applied_to_trait ( attr. span ( ) , span, target) ,
284
287
[ sym:: collapse_debuginfo, ..] => self . check_collapse_debuginfo ( attr, span, target) ,
285
288
[ sym:: must_not_suspend, ..] => self . check_must_not_suspend ( attr, span, target) ,
286
- [ sym:: rustc_pass_by_value, ..] => self . check_pass_by_value ( attr, span, target) ,
287
289
[ sym:: rustc_allow_incoherent_impl, ..] => {
288
290
self . check_allow_incoherent_impl ( attr, span, target)
289
291
}
@@ -1465,11 +1467,11 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
1465
1467
}
1466
1468
1467
1469
/// Warns against some misuses of `#[pass_by_value]`
1468
- fn check_pass_by_value ( & self , attr : & Attribute , span : Span , target : Target ) {
1470
+ fn check_pass_by_value ( & self , attr_span : Span , span : Span , target : Target ) {
1469
1471
match target {
1470
1472
Target :: Struct | Target :: Enum | Target :: TyAlias => { }
1471
1473
_ => {
1472
- self . dcx ( ) . emit_err ( errors:: PassByValue { attr_span : attr . span ( ) , span } ) ;
1474
+ self . dcx ( ) . emit_err ( errors:: PassByValue { attr_span, span } ) ;
1473
1475
}
1474
1476
}
1475
1477
}
0 commit comments