Skip to content

Commit 30d57ab

Browse files
committed
mbe: Rename a local variable to match corresponding field names
This simplifies subsequent initialization of enum variants.
1 parent 128b36a commit 30d57ab

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

compiler/rustc_expand/src/mbe/macro_rules.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -741,10 +741,10 @@ pub fn compile_declarative_macro(
741741
if let Some(guar) = check_no_eof(sess, &p, "expected right-hand side of macro rule") {
742742
return dummy_syn_ext(guar);
743743
}
744-
let rhs_tt = p.parse_token_tree();
745-
let rhs_tt = parse_one_tt(rhs_tt, RulePart::Body, sess, node_id, features, edition);
746-
check_emission(check_rhs(sess, &rhs_tt));
747-
check_emission(check_meta_variables(&sess.psess, node_id, args.as_ref(), &lhs_tt, &rhs_tt));
744+
let rhs = p.parse_token_tree();
745+
let rhs = parse_one_tt(rhs, RulePart::Body, sess, node_id, features, edition);
746+
check_emission(check_rhs(sess, &rhs));
747+
check_emission(check_meta_variables(&sess.psess, node_id, args.as_ref(), &lhs_tt, &rhs));
748748
let lhs_span = lhs_tt.span();
749749
// Convert the lhs into `MatcherLoc` form, which is better for doing the
750750
// actual matching.
@@ -760,11 +760,11 @@ pub fn compile_declarative_macro(
760760
};
761761
let args = mbe::macro_parser::compute_locs(&delimited.tts);
762762
let body_span = lhs_span;
763-
rules.push(MacroRule::Attr { args, args_span, body: lhs, body_span, rhs: rhs_tt });
763+
rules.push(MacroRule::Attr { args, args_span, body: lhs, body_span, rhs });
764764
} else if is_derive {
765-
rules.push(MacroRule::Derive { body: lhs, body_span: lhs_span, rhs: rhs_tt });
765+
rules.push(MacroRule::Derive { body: lhs, body_span: lhs_span, rhs });
766766
} else {
767-
rules.push(MacroRule::Func { lhs, lhs_span, rhs: rhs_tt });
767+
rules.push(MacroRule::Func { lhs, lhs_span, rhs });
768768
}
769769
if p.token == token::Eof {
770770
break;

0 commit comments

Comments
 (0)