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