@@ -146,6 +146,9 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
146146 Attribute :: Parsed ( AttributeKind :: Fundamental ) => {
147147 // FIXME: add validation
148148 }
149+ & Attribute :: Parsed ( AttributeKind :: AllowIncoherentImpl ( attr_span) ) => {
150+ self . check_allow_incoherent_impl ( attr_span, span, target)
151+ }
149152 Attribute :: Parsed ( AttributeKind :: Confusables { first_span, .. } ) => {
150153 self . check_confusables ( * first_span, target) ;
151154 }
@@ -309,9 +312,6 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
309312 [ sym:: rustc_must_implement_one_of, ..] => self . check_must_be_applied_to_trait ( attr. span ( ) , span, target) ,
310313 [ sym:: collapse_debuginfo, ..] => self . check_collapse_debuginfo ( attr, span, target) ,
311314 [ sym:: must_not_suspend, ..] => self . check_must_not_suspend ( attr, span, target) ,
312- [ sym:: rustc_allow_incoherent_impl, ..] => {
313- self . check_allow_incoherent_impl ( attr, span, target)
314- }
315315 [ sym:: rustc_has_incoherent_inherent_impls, ..] => {
316316 self . check_has_incoherent_inherent_impls ( attr, span, target)
317317 }
@@ -1491,11 +1491,11 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
14911491 }
14921492 }
14931493
1494- fn check_allow_incoherent_impl ( & self , attr : & Attribute , span : Span , target : Target ) {
1494+ fn check_allow_incoherent_impl ( & self , attr_span : Span , span : Span , target : Target ) {
14951495 match target {
14961496 Target :: Method ( MethodKind :: Inherent ) => { }
14971497 _ => {
1498- self . dcx ( ) . emit_err ( errors:: AllowIncoherentImpl { attr_span : attr . span ( ) , span } ) ;
1498+ self . dcx ( ) . emit_err ( errors:: AllowIncoherentImpl { attr_span, span } ) ;
14991499 }
15001500 }
15011501 }
0 commit comments