@@ -20,7 +20,6 @@ use rustc_feature::is_builtin_attr_name;
2020use rustc_hir:: def:: { self , DefKind , NonMacroAttrKind } ;
2121use rustc_hir:: def_id;
2222use rustc_session:: lint:: builtin:: UNUSED_MACROS ;
23- use rustc_session:: parse:: feature_err;
2423use rustc_session:: Session ;
2524use rustc_span:: edition:: Edition ;
2625use rustc_span:: hygiene:: { self , ExpnData , ExpnId , ExpnKind } ;
@@ -397,20 +396,16 @@ impl<'a> Resolver<'a> {
397396 Err ( Determinacy :: Undetermined ) => return Err ( Indeterminate ) ,
398397 } ;
399398
400- // Report errors and enforce feature gates for the resolved macro.
401- let features = self . session . features_untracked ( ) ;
399+ // Report errors for the resolved macro.
402400 for segment in & path. segments {
403401 if let Some ( args) = & segment. args {
404402 self . session . span_err ( args. span ( ) , "generic arguments in macro path" ) ;
405403 }
406- if kind == MacroKind :: Attr
407- && !features. rustc_attrs
408- && segment. ident . as_str ( ) . starts_with ( "rustc" )
409- {
410- let msg =
411- "attributes starting with `rustc` are reserved for use by the `rustc` compiler" ;
412- feature_err ( & self . session . parse_sess , sym:: rustc_attrs, segment. ident . span , msg)
413- . emit ( ) ;
404+ if kind == MacroKind :: Attr && segment. ident . as_str ( ) . starts_with ( "rustc" ) {
405+ self . session . span_err (
406+ segment. ident . span ,
407+ "attributes starting with `rustc` are reserved for use by the `rustc` compiler" ,
408+ ) ;
414409 }
415410 }
416411
0 commit comments