@@ -20,7 +20,6 @@ use rustc_feature::is_builtin_attr_name;
20
20
use rustc_hir:: def:: { self , DefKind , NonMacroAttrKind } ;
21
21
use rustc_hir:: def_id;
22
22
use rustc_session:: lint:: builtin:: UNUSED_MACROS ;
23
- use rustc_session:: parse:: feature_err;
24
23
use rustc_session:: Session ;
25
24
use rustc_span:: edition:: Edition ;
26
25
use rustc_span:: hygiene:: { self , ExpnData , ExpnId , ExpnKind } ;
@@ -397,20 +396,16 @@ impl<'a> Resolver<'a> {
397
396
Err ( Determinacy :: Undetermined ) => return Err ( Indeterminate ) ,
398
397
} ;
399
398
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.
402
400
for segment in & path. segments {
403
401
if let Some ( args) = & segment. args {
404
402
self . session . span_err ( args. span ( ) , "generic arguments in macro path" ) ;
405
403
}
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
+ ) ;
414
409
}
415
410
}
416
411
0 commit comments