Skip to content

Commit 12c6d3e

Browse files
committed
wip: Undo unnecessary refactoring
1 parent df518db commit 12c6d3e

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

compiler/rustc_expand/src/expand.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
512512
self.cx.force_mode = force;
513513

514514
let fragment_kind = invoc.fragment_kind;
515-
match self.expand_invoc(invoc, &ext) {
515+
match self.expand_invoc(invoc, &ext.kind) {
516516
ExpandResult::Ready(fragment) => {
517517
let mut derive_invocations = Vec::new();
518518
let derive_placeholders = self
@@ -674,7 +674,7 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
674674
fn expand_invoc(
675675
&mut self,
676676
invoc: Invocation,
677-
ext: &Lrc<SyntaxExtension>,
677+
ext: &SyntaxExtensionKind,
678678
) -> ExpandResult<AstFragment, Invocation> {
679679
let recursion_limit = match self.cx.reduced_recursion_limit {
680680
Some((limit, _)) => limit,
@@ -695,7 +695,7 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
695695

696696
let (fragment_kind, span) = (invoc.fragment_kind, invoc.span());
697697
ExpandResult::Ready(match invoc.kind {
698-
InvocationKind::Bang { mac, span } => match &ext.kind {
698+
InvocationKind::Bang { mac, span } => match ext {
699699
SyntaxExtensionKind::Bang(expander) => {
700700
match expander.expand(self.cx, span, mac.args.tokens.clone()) {
701701
Ok(tok_result) => {
@@ -725,7 +725,7 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
725725
}
726726
_ => unreachable!(),
727727
},
728-
InvocationKind::Attr { attr, pos, mut item, derives } => match &ext.kind {
728+
InvocationKind::Attr { attr, pos, mut item, derives } => match ext {
729729
SyntaxExtensionKind::Attr(expander) => {
730730
self.gate_proc_macro_input(&item);
731731
self.gate_proc_macro_attr_item(span, &item);
@@ -804,10 +804,10 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
804804
}
805805
_ => unreachable!(),
806806
},
807-
InvocationKind::Derive { path, item, is_const } => match &ext.kind {
807+
InvocationKind::Derive { path, item, is_const } => match ext {
808808
SyntaxExtensionKind::Derive(expander)
809809
| SyntaxExtensionKind::LegacyDerive(expander) => {
810-
if let SyntaxExtensionKind::Derive(..) = ext.kind {
810+
if let SyntaxExtensionKind::Derive(..) = ext {
811811
self.gate_proc_macro_input(&item);
812812
}
813813
// The `MetaItem` representing the trait to derive can't
@@ -818,7 +818,6 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
818818
span,
819819
path,
820820
};
821-
invoc.expansion_data.id.expn_data();
822821
let items = match expander.expand(self.cx, span, &meta, item, is_const) {
823822
ExpandResult::Ready(items) => items,
824823
ExpandResult::Retry(item) => {

0 commit comments

Comments
 (0)