@@ -645,18 +645,18 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
645645 let ( kind, gate) = match * item {
646646 Annotatable :: Item ( ref item) => {
647647 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 " ) ,
650650 _ => return ,
651651 }
652652 }
653653 Annotatable :: TraitItem ( _) => return ,
654654 Annotatable :: ImplItem ( _) => return ,
655655 Annotatable :: ForeignItem ( _) => return ,
656656 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 " ) ,
660660 } ;
661661 emit_feature_err (
662662 self . cx . parse_sess ,
@@ -668,7 +668,7 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
668668 }
669669
670670 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 ( ) {
672672 return
673673 }
674674 let fragment = match fragment {
@@ -691,7 +691,7 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
691691 if let ast:: ItemKind :: MacroDef ( _) = i. node {
692692 emit_feature_err (
693693 self . parse_sess ,
694- "proc_macro_gen " ,
694+ "proc_macro_hygiene " ,
695695 self . span ,
696696 GateIssue :: Language ,
697697 & format ! ( "procedural macros cannot expand to macro definitions" ) ,
@@ -885,12 +885,12 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
885885 AstFragmentKind :: ImplItems => return ,
886886 AstFragmentKind :: ForeignItems => return ,
887887 } ;
888- if self . cx . ecfg . proc_macro_non_items ( ) {
888+ if self . cx . ecfg . proc_macro_hygiene ( ) {
889889 return
890890 }
891891 emit_feature_err (
892892 self . cx . parse_sess ,
893- "proc_macro_non_items " ,
893+ "proc_macro_hygiene " ,
894894 span,
895895 GateIssue :: Language ,
896896 & format ! ( "procedural macros cannot be expanded to {}" , kind) ,
@@ -1612,10 +1612,7 @@ impl<'feat> ExpansionConfig<'feat> {
16121612 fn enable_custom_derive = custom_derive,
16131613 fn enable_format_args_nl = format_args_nl,
16141614 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,
16191616 }
16201617
16211618 fn enable_custom_inner_attributes ( & self ) -> bool {
0 commit comments