@@ -221,6 +221,9 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
221221 Attribute :: Parsed ( AttributeKind :: Used { span : attr_span, .. } ) => {
222222 self . check_used ( * attr_span, target, span) ;
223223 }
224+ & Attribute :: Parsed ( AttributeKind :: PassByValue ( attr_span) ) => {
225+ self . check_pass_by_value ( attr_span, span, target)
226+ }
224227 Attribute :: Unparsed ( attr_item) => {
225228 style = Some ( attr_item. style ) ;
226229 match attr. path ( ) . as_slice ( ) {
@@ -283,7 +286,6 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
283286 | [ sym:: const_trait, ..] => self . check_must_be_applied_to_trait ( attr. span ( ) , span, target) ,
284287 [ sym:: collapse_debuginfo, ..] => self . check_collapse_debuginfo ( attr, span, target) ,
285288 [ 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) ,
287289 [ sym:: rustc_allow_incoherent_impl, ..] => {
288290 self . check_allow_incoherent_impl ( attr, span, target)
289291 }
@@ -1465,11 +1467,11 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
14651467 }
14661468
14671469 /// 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 ) {
14691471 match target {
14701472 Target :: Struct | Target :: Enum | Target :: TyAlias => { }
14711473 _ => {
1472- self . dcx ( ) . emit_err ( errors:: PassByValue { attr_span : attr . span ( ) , span } ) ;
1474+ self . dcx ( ) . emit_err ( errors:: PassByValue { attr_span, span } ) ;
14731475 }
14741476 }
14751477 }
0 commit comments