@@ -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 }
@@ -319,9 +322,6 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
319322 [ sym:: rustc_must_implement_one_of, ..] => self . check_must_be_applied_to_trait ( attr. span ( ) , span, target) ,
320323 [ sym:: collapse_debuginfo, ..] => self . check_collapse_debuginfo ( attr, span, target) ,
321324 [ sym:: must_not_suspend, ..] => self . check_must_not_suspend ( attr, span, target) ,
322- [ sym:: rustc_allow_incoherent_impl, ..] => {
323- self . check_allow_incoherent_impl ( attr, span, target)
324- }
325325 [ sym:: rustc_has_incoherent_inherent_impls, ..] => {
326326 self . check_has_incoherent_inherent_impls ( attr, span, target)
327327 }
@@ -1498,11 +1498,11 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
14981498 }
14991499 }
15001500
1501- fn check_allow_incoherent_impl ( & self , attr : & Attribute , span : Span , target : Target ) {
1501+ fn check_allow_incoherent_impl ( & self , attr_span : Span , span : Span , target : Target ) {
15021502 match target {
15031503 Target :: Method ( MethodKind :: Inherent ) => { }
15041504 _ => {
1505- self . dcx ( ) . emit_err ( errors:: AllowIncoherentImpl { attr_span : attr . span ( ) , span } ) ;
1505+ self . dcx ( ) . emit_err ( errors:: AllowIncoherentImpl { attr_span, span } ) ;
15061506 }
15071507 }
15081508 }
0 commit comments