@@ -512,7 +512,7 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
512
512
self . cx . force_mode = force;
513
513
514
514
let fragment_kind = invoc. fragment_kind ;
515
- match self . expand_invoc ( invoc, & ext) {
515
+ match self . expand_invoc ( invoc, & ext. kind ) {
516
516
ExpandResult :: Ready ( fragment) => {
517
517
let mut derive_invocations = Vec :: new ( ) ;
518
518
let derive_placeholders = self
@@ -674,7 +674,7 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
674
674
fn expand_invoc (
675
675
& mut self ,
676
676
invoc : Invocation ,
677
- ext : & Lrc < SyntaxExtension > ,
677
+ ext : & SyntaxExtensionKind ,
678
678
) -> ExpandResult < AstFragment , Invocation > {
679
679
let recursion_limit = match self . cx . reduced_recursion_limit {
680
680
Some ( ( limit, _) ) => limit,
@@ -695,7 +695,7 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
695
695
696
696
let ( fragment_kind, span) = ( invoc. fragment_kind , invoc. span ( ) ) ;
697
697
ExpandResult :: Ready ( match invoc. kind {
698
- InvocationKind :: Bang { mac, span } => match & ext. kind {
698
+ InvocationKind :: Bang { mac, span } => match ext {
699
699
SyntaxExtensionKind :: Bang ( expander) => {
700
700
match expander. expand ( self . cx , span, mac. args . tokens . clone ( ) ) {
701
701
Ok ( tok_result) => {
@@ -725,7 +725,7 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
725
725
}
726
726
_ => unreachable ! ( ) ,
727
727
} ,
728
- InvocationKind :: Attr { attr, pos, mut item, derives } => match & ext. kind {
728
+ InvocationKind :: Attr { attr, pos, mut item, derives } => match ext {
729
729
SyntaxExtensionKind :: Attr ( expander) => {
730
730
self . gate_proc_macro_input ( & item) ;
731
731
self . gate_proc_macro_attr_item ( span, & item) ;
@@ -804,10 +804,10 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
804
804
}
805
805
_ => unreachable ! ( ) ,
806
806
} ,
807
- InvocationKind :: Derive { path, item, is_const } => match & ext. kind {
807
+ InvocationKind :: Derive { path, item, is_const } => match ext {
808
808
SyntaxExtensionKind :: Derive ( expander)
809
809
| SyntaxExtensionKind :: LegacyDerive ( expander) => {
810
- if let SyntaxExtensionKind :: Derive ( ..) = ext. kind {
810
+ if let SyntaxExtensionKind :: Derive ( ..) = ext {
811
811
self . gate_proc_macro_input ( & item) ;
812
812
}
813
813
// The `MetaItem` representing the trait to derive can't
@@ -818,7 +818,6 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
818
818
span,
819
819
path,
820
820
} ;
821
- invoc. expansion_data . id . expn_data ( ) ;
822
821
let items = match expander. expand ( self . cx , span, & meta, item, is_const) {
823
822
ExpandResult :: Ready ( items) => items,
824
823
ExpandResult :: Retry ( item) => {
0 commit comments