Rename _args -> args in format_args expansion

This commit is contained in:
David Tolnay 2022-01-29 12:44:41 -08:00
parent a00e130dae
commit 6667d785d8
No known key found for this signature in database
GPG key ID: F9BA143B95FF6D82
2 changed files with 4 additions and 4 deletions
compiler
rustc_builtin_macros/src
rustc_span/src

View file

@ -791,7 +791,7 @@ impl<'a, 'b> Context<'a, 'b> {
// Thus in the not nicely ordered case we emit the following instead: // Thus in the not nicely ordered case we emit the following instead:
// //
// match (&$arg0, &$arg1, …) { // match (&$arg0, &$arg1, …) {
// _args => [ArgumentV1::new(_args.$i, …), ArgumentV1::new(_args.$j, …), …] // args => [ArgumentV1::new(args.$i, …), ArgumentV1::new(args.$j, …), …]
// } // }
// //
// for the sequence of indices $i, $j, … governed by fmt_arg_index_and_ty. // for the sequence of indices $i, $j, … governed by fmt_arg_index_and_ty.
@ -804,7 +804,7 @@ impl<'a, 'b> Context<'a, 'b> {
self.ecx.expr_addr_of(expansion_span, P(e.take())) self.ecx.expr_addr_of(expansion_span, P(e.take()))
} else { } else {
let def_site = self.ecx.with_def_site_ctxt(span); let def_site = self.ecx.with_def_site_ctxt(span);
let args_tuple = self.ecx.expr_ident(def_site, Ident::new(sym::_args, def_site)); let args_tuple = self.ecx.expr_ident(def_site, Ident::new(sym::args, def_site));
let member = Ident::new(sym::integer(arg_index), def_site); let member = Ident::new(sym::integer(arg_index), def_site);
self.ecx.expr(def_site, ast::ExprKind::Field(args_tuple, member)) self.ecx.expr(def_site, ast::ExprKind::Field(args_tuple, member))
}; };
@ -828,7 +828,7 @@ impl<'a, 'b> Context<'a, 'b> {
.map(|e| self.ecx.expr_addr_of(e.span.with_ctxt(self.macsp.ctxt()), e)) .map(|e| self.ecx.expr_addr_of(e.span.with_ctxt(self.macsp.ctxt()), e))
.collect(); .collect();
let pat = self.ecx.pat_ident(self.macsp, Ident::new(sym::_args, self.macsp)); let pat = self.ecx.pat_ident(self.macsp, Ident::new(sym::args, self.macsp));
let arm = self.ecx.arm(self.macsp, pat, args_array); let arm = self.ecx.arm(self.macsp, pat, args_array);
let head = self.ecx.expr(self.macsp, ast::ExprKind::Tup(heads)); let head = self.ecx.expr(self.macsp, ast::ExprKind::Tup(heads));
self.ecx.expr_match(self.macsp, head, vec![arm]) self.ecx.expr_match(self.macsp, head, vec![arm])

View file

@ -272,7 +272,6 @@ symbols! {
__H, __H,
__S, __S,
__try_var, __try_var,
_args,
_d, _d,
_e, _e,
_task_context, _task_context,
@ -324,6 +323,7 @@ symbols! {
append_const_msg, append_const_msg,
arbitrary_enum_discriminant, arbitrary_enum_discriminant,
arbitrary_self_types, arbitrary_self_types,
args,
arith_offset, arith_offset,
arm, arm,
arm_target_feature, arm_target_feature,