@@ -487,7 +487,7 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
487487
488488 fn expand_invoc ( & mut self , invoc : Invocation , ext : & SyntaxExtension ) -> Option < AstFragment > {
489489 if invoc. fragment_kind == AstFragmentKind :: ForeignItems &&
490- !self . cx . ecfg . macros_in_extern_enabled ( ) {
490+ !self . cx . ecfg . macros_in_extern ( ) {
491491 if let SyntaxExtensionKind :: NonMacroAttr { .. } = ext. kind { } else {
492492 emit_feature_err ( & self . cx . parse_sess , sym:: macros_in_extern,
493493 invoc. span ( ) , GateIssue :: Language ,
@@ -919,7 +919,7 @@ impl<'a, 'b> InvocationCollector<'a, 'b> {
919919 } )
920920 . map ( |i| attrs. remove ( i) ) ;
921921 if let Some ( attr) = & attr {
922- if !self . cx . ecfg . enable_custom_inner_attributes ( ) &&
922+ if !self . cx . ecfg . custom_inner_attributes ( ) &&
923923 attr. style == ast:: AttrStyle :: Inner && attr. path != sym:: test {
924924 emit_feature_err ( & self . cx . parse_sess , sym:: custom_inner_attributes,
925925 attr. span , GateIssue :: Language ,
@@ -1432,19 +1432,6 @@ pub struct ExpansionConfig<'feat> {
14321432 pub keep_macs : bool ,
14331433}
14341434
1435- macro_rules! feature_tests {
1436- ( $( fn $getter: ident = $field: ident, ) * ) => {
1437- $(
1438- pub fn $getter( & self ) -> bool {
1439- match self . features {
1440- Some ( & Features { $field: true , .. } ) => true ,
1441- _ => false ,
1442- }
1443- }
1444- ) *
1445- }
1446- }
1447-
14481435impl < ' feat > ExpansionConfig < ' feat > {
14491436 pub fn default ( crate_name : String ) -> ExpansionConfig < ' static > {
14501437 ExpansionConfig {
@@ -1458,20 +1445,13 @@ impl<'feat> ExpansionConfig<'feat> {
14581445 }
14591446 }
14601447
1461- feature_tests ! {
1462- fn enable_asm = asm,
1463- fn enable_custom_test_frameworks = custom_test_frameworks,
1464- fn enable_global_asm = global_asm,
1465- fn enable_log_syntax = log_syntax,
1466- fn enable_concat_idents = concat_idents,
1467- fn enable_trace_macros = trace_macros,
1468- fn enable_allow_internal_unstable = allow_internal_unstable,
1469- fn enable_format_args_nl = format_args_nl,
1470- fn macros_in_extern_enabled = macros_in_extern,
1471- fn proc_macro_hygiene = proc_macro_hygiene,
1448+ fn macros_in_extern ( & self ) -> bool {
1449+ self . features . map_or ( false , |features| features. macros_in_extern )
14721450 }
1473-
1474- fn enable_custom_inner_attributes ( & self ) -> bool {
1451+ fn proc_macro_hygiene ( & self ) -> bool {
1452+ self . features . map_or ( false , |features| features. proc_macro_hygiene )
1453+ }
1454+ fn custom_inner_attributes ( & self ) -> bool {
14751455 self . features . map_or ( false , |features| features. custom_inner_attributes )
14761456 }
14771457}
0 commit comments