Skip to content

Commit 258f8db

Browse files
committed
mbe: Rename a local variable to match corresponding field names
This simplifies subsequent initialization of enum variants.
1 parent 60a5372 commit 258f8db

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
@@ -742,10 +742,10 @@ pub fn compile_declarative_macro(
742742
if let Some(guar) = check_no_eof(sess, &p, "expected right-hand side of macro rule") {
743743
return dummy_syn_ext(guar);
744744
}
745-
let rhs_tt = p.parse_token_tree();
746-
let rhs_tt = parse_one_tt(rhs_tt, RulePart::Body, sess, node_id, features, edition);
747-
check_emission(check_rhs(sess, &rhs_tt));
748-
check_emission(check_meta_variables(&sess.psess, node_id, args.as_ref(), &lhs_tt, &rhs_tt));
745+
let rhs = p.parse_token_tree();
746+
let rhs = parse_one_tt(rhs, RulePart::Body, sess, node_id, features, edition);
747+
check_emission(check_rhs(sess, &rhs));
748+
check_emission(check_meta_variables(&sess.psess, node_id, args.as_ref(), &lhs_tt, &rhs));
749749
let lhs_span = lhs_tt.span();
750750
// Convert the lhs into `MatcherLoc` form, which is better for doing the
751751
// actual matching.
@@ -761,11 +761,11 @@ pub fn compile_declarative_macro(
761761
};
762762
let args = mbe::macro_parser::compute_locs(&delimited.tts);
763763
let body_span = lhs_span;
764-
rules.push(MacroRule::Attr { args, args_span, body: lhs, body_span, rhs: rhs_tt });
764+
rules.push(MacroRule::Attr { args, args_span, body: lhs, body_span, rhs });
765765
} else if is_derive {
766-
rules.push(MacroRule::Derive { body: lhs, body_span: lhs_span, rhs: rhs_tt });
766+
rules.push(MacroRule::Derive { body: lhs, body_span: lhs_span, rhs });
767767
} else {
768-
rules.push(MacroRule::Func { lhs, lhs_span, rhs: rhs_tt });
768+
rules.push(MacroRule::Func { lhs, lhs_span, rhs });
769769
}
770770
if p.token == token::Eof {
771771
break;

0 commit comments

Comments
 (0)