@@ -488,7 +488,7 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
488
488
self . cx . force_mode = force;
489
489
490
490
let fragment_kind = invoc. fragment_kind ;
491
- match self . expand_invoc ( invoc, & ext. kind ) {
491
+ match self . expand_invoc ( invoc, & ext) {
492
492
ExpandResult :: Ready ( fragment) => {
493
493
let mut derive_invocations = Vec :: new ( ) ;
494
494
let derive_placeholders = self
@@ -650,7 +650,7 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
650
650
fn expand_invoc (
651
651
& mut self ,
652
652
invoc : Invocation ,
653
- ext : & SyntaxExtensionKind ,
653
+ ext : & Lrc < SyntaxExtension > ,
654
654
) -> ExpandResult < AstFragment , Invocation > {
655
655
let recursion_limit = match self . cx . reduced_recursion_limit {
656
656
Some ( ( limit, _) ) => limit,
@@ -671,7 +671,7 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
671
671
672
672
let ( fragment_kind, span) = ( invoc. fragment_kind , invoc. span ( ) ) ;
673
673
ExpandResult :: Ready ( match invoc. kind {
674
- InvocationKind :: Bang { mac, span } => match ext {
674
+ InvocationKind :: Bang { mac, span } => match & ext. kind {
675
675
SyntaxExtensionKind :: Bang ( expander) => {
676
676
match expander. expand ( self . cx , span, mac. args . tokens . clone ( ) ) {
677
677
Ok ( tok_result) => {
@@ -701,7 +701,7 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
701
701
}
702
702
_ => unreachable ! ( ) ,
703
703
} ,
704
- InvocationKind :: Attr { attr, pos, mut item, derives } => match ext {
704
+ InvocationKind :: Attr { attr, pos, mut item, derives } => match & ext. kind {
705
705
SyntaxExtensionKind :: Attr ( expander) => {
706
706
self . gate_proc_macro_input ( & item) ;
707
707
self . gate_proc_macro_attr_item ( span, & item) ;
@@ -780,10 +780,10 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
780
780
}
781
781
_ => unreachable ! ( ) ,
782
782
} ,
783
- InvocationKind :: Derive { path, item, is_const } => match ext {
783
+ InvocationKind :: Derive { path, item, is_const } => match & ext. kind {
784
784
SyntaxExtensionKind :: Derive ( expander)
785
785
| SyntaxExtensionKind :: LegacyDerive ( expander) => {
786
- if let SyntaxExtensionKind :: Derive ( ..) = ext {
786
+ if let SyntaxExtensionKind :: Derive ( ..) = ext. kind {
787
787
self . gate_proc_macro_input ( & item) ;
788
788
}
789
789
// The `MetaItem` representing the trait to derive can't
@@ -810,18 +810,19 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
810
810
} ,
811
811
InvocationKind :: GlobDelegation { item } => {
812
812
let AssocItemKind :: DelegationMac ( deleg) = & item. kind else { unreachable ! ( ) } ;
813
- let suffixes = match ext {
814
- SyntaxExtensionKind :: GlobDelegation ( expander) => match expander. expand ( self . cx )
815
- {
816
- ExpandResult :: Ready ( suffixes) => suffixes,
817
- ExpandResult :: Retry ( ( ) ) => {
818
- // Reassemble the original invocation for retrying.
819
- return ExpandResult :: Retry ( Invocation {
820
- kind : InvocationKind :: GlobDelegation { item } ,
821
- ..invoc
822
- } ) ;
813
+ let suffixes = match & ext. kind {
814
+ SyntaxExtensionKind :: GlobDelegation ( expander) => {
815
+ match expander. expand ( self . cx ) {
816
+ ExpandResult :: Ready ( suffixes) => suffixes,
817
+ ExpandResult :: Retry ( ( ) ) => {
818
+ // Reassemble the original invocation for retrying.
819
+ return ExpandResult :: Retry ( Invocation {
820
+ kind : InvocationKind :: GlobDelegation { item } ,
821
+ ..invoc
822
+ } ) ;
823
+ }
823
824
}
824
- } ,
825
+ }
825
826
SyntaxExtensionKind :: LegacyBang ( ..) => {
826
827
let msg = "expanded a dummy glob delegation" ;
827
828
let guar = self . cx . dcx ( ) . span_delayed_bug ( span, msg) ;
0 commit comments