@@ -487,7 +487,7 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
487
487
488
488
fn expand_invoc ( & mut self , invoc : Invocation , ext : & SyntaxExtension ) -> Option < AstFragment > {
489
489
if invoc. fragment_kind == AstFragmentKind :: ForeignItems &&
490
- !self . cx . ecfg . macros_in_extern_enabled ( ) {
490
+ !self . cx . ecfg . macros_in_extern ( ) {
491
491
if let SyntaxExtensionKind :: NonMacroAttr { .. } = ext. kind { } else {
492
492
emit_feature_err ( & self . cx . parse_sess , sym:: macros_in_extern,
493
493
invoc. span ( ) , GateIssue :: Language ,
@@ -919,7 +919,7 @@ impl<'a, 'b> InvocationCollector<'a, 'b> {
919
919
} )
920
920
. map ( |i| attrs. remove ( i) ) ;
921
921
if let Some ( attr) = & attr {
922
- if !self . cx . ecfg . enable_custom_inner_attributes ( ) &&
922
+ if !self . cx . ecfg . custom_inner_attributes ( ) &&
923
923
attr. style == ast:: AttrStyle :: Inner && attr. path != sym:: test {
924
924
emit_feature_err ( & self . cx . parse_sess , sym:: custom_inner_attributes,
925
925
attr. span , GateIssue :: Language ,
@@ -1432,19 +1432,6 @@ pub struct ExpansionConfig<'feat> {
1432
1432
pub keep_macs : bool ,
1433
1433
}
1434
1434
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
-
1448
1435
impl < ' feat > ExpansionConfig < ' feat > {
1449
1436
pub fn default ( crate_name : String ) -> ExpansionConfig < ' static > {
1450
1437
ExpansionConfig {
@@ -1458,20 +1445,13 @@ impl<'feat> ExpansionConfig<'feat> {
1458
1445
}
1459
1446
}
1460
1447
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 )
1472
1450
}
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 {
1475
1455
self . features . map_or ( false , |features| features. custom_inner_attributes )
1476
1456
}
1477
1457
}
0 commit comments