Rollup merge of #90131 - camsteffen:fmt-args-span-fix, r=cjgillot
Fix a format_args span to be expansion I found this while exploring solutions for rust-lang/rust-clippy#7843. r? `@m-ou-se`
This commit is contained in:
commit
9715724006
26 changed files with 51 additions and 1 deletions
|
@ -769,7 +769,10 @@ impl<'a, 'b> Context<'a, 'b> {
|
|||
for arg_ty in self.arg_unique_types[i].iter() {
|
||||
args.push(Context::format_arg(self.ecx, self.macsp, e.span, arg_ty, i));
|
||||
}
|
||||
heads.push(self.ecx.expr_addr_of(e.span, e));
|
||||
// use the arg span for `&arg` so that borrowck errors
|
||||
// point to the specific expression passed to the macro
|
||||
// (the span is otherwise unavailable in MIR)
|
||||
heads.push(self.ecx.expr_addr_of(e.span.with_ctxt(self.macsp.ctxt()), e));
|
||||
}
|
||||
for pos in self.count_args {
|
||||
let index = match pos {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue