@@ -645,18 +645,18 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
645
645
let ( kind, gate) = match * item {
646
646
Annotatable :: Item ( ref item) => {
647
647
match item. node {
648
- ItemKind :: Mod ( _) if self . cx . ecfg . proc_macro_mod ( ) => return ,
649
- ItemKind :: Mod ( _) => ( "modules" , "proc_macro_mod " ) ,
648
+ ItemKind :: Mod ( _) if self . cx . ecfg . proc_macro_hygiene ( ) => return ,
649
+ ItemKind :: Mod ( _) => ( "modules" , "proc_macro_hygiene " ) ,
650
650
_ => return ,
651
651
}
652
652
}
653
653
Annotatable :: TraitItem ( _) => return ,
654
654
Annotatable :: ImplItem ( _) => return ,
655
655
Annotatable :: ForeignItem ( _) => return ,
656
656
Annotatable :: Stmt ( _) |
657
- Annotatable :: Expr ( _) if self . cx . ecfg . proc_macro_expr ( ) => return ,
658
- Annotatable :: Stmt ( _) => ( "statements" , "proc_macro_expr " ) ,
659
- Annotatable :: Expr ( _) => ( "expressions" , "proc_macro_expr " ) ,
657
+ Annotatable :: Expr ( _) if self . cx . ecfg . proc_macro_hygiene ( ) => return ,
658
+ Annotatable :: Stmt ( _) => ( "statements" , "proc_macro_hygiene " ) ,
659
+ Annotatable :: Expr ( _) => ( "expressions" , "proc_macro_hygiene " ) ,
660
660
} ;
661
661
emit_feature_err (
662
662
self . cx . parse_sess ,
@@ -668,7 +668,7 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
668
668
}
669
669
670
670
fn gate_proc_macro_expansion ( & self , span : Span , fragment : & Option < AstFragment > ) {
671
- if self . cx . ecfg . proc_macro_gen ( ) {
671
+ if self . cx . ecfg . proc_macro_hygiene ( ) {
672
672
return
673
673
}
674
674
let fragment = match fragment {
@@ -691,7 +691,7 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
691
691
if let ast:: ItemKind :: MacroDef ( _) = i. node {
692
692
emit_feature_err (
693
693
self . parse_sess ,
694
- "proc_macro_gen " ,
694
+ "proc_macro_hygiene " ,
695
695
self . span ,
696
696
GateIssue :: Language ,
697
697
& format ! ( "procedural macros cannot expand to macro definitions" ) ,
@@ -885,12 +885,12 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
885
885
AstFragmentKind :: ImplItems => return ,
886
886
AstFragmentKind :: ForeignItems => return ,
887
887
} ;
888
- if self . cx . ecfg . proc_macro_non_items ( ) {
888
+ if self . cx . ecfg . proc_macro_hygiene ( ) {
889
889
return
890
890
}
891
891
emit_feature_err (
892
892
self . cx . parse_sess ,
893
- "proc_macro_non_items " ,
893
+ "proc_macro_hygiene " ,
894
894
span,
895
895
GateIssue :: Language ,
896
896
& format ! ( "procedural macros cannot be expanded to {}" , kind) ,
@@ -1612,10 +1612,7 @@ impl<'feat> ExpansionConfig<'feat> {
1612
1612
fn enable_custom_derive = custom_derive,
1613
1613
fn enable_format_args_nl = format_args_nl,
1614
1614
fn macros_in_extern_enabled = macros_in_extern,
1615
- fn proc_macro_mod = proc_macro_mod,
1616
- fn proc_macro_gen = proc_macro_gen,
1617
- fn proc_macro_expr = proc_macro_expr,
1618
- fn proc_macro_non_items = proc_macro_non_items,
1615
+ fn proc_macro_hygiene = proc_macro_hygiene,
1619
1616
}
1620
1617
1621
1618
fn enable_custom_inner_attributes ( & self ) -> bool {
0 commit comments