Skip to content

Commit bbc00c9

Browse files
committed
format!: use a dummy span rather than callee span for the span base for temporary variables
1 parent e1206c4 commit bbc00c9

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/libsyntax_ext/format.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use syntax::ext::build::AstBuilder;
2020
use syntax::parse::token;
2121
use syntax::ptr::P;
2222
use syntax::symbol::{Symbol, keywords};
23-
use syntax_pos::Span;
23+
use syntax_pos::{Span, DUMMY_SP};
2424
use syntax::tokenstream;
2525

2626
use std::collections::{HashMap, HashSet};
@@ -558,8 +558,10 @@ impl<'a, 'b> Context<'a, 'b> {
558558
// passed to this function.
559559
for (i, e) in self.args.into_iter().enumerate() {
560560
let name = self.ecx.ident_of(&format!("__arg{}", i));
561-
let span =
562-
Span { ctxt: e.span.ctxt.apply_mark(self.ecx.current_expansion.mark), ..e.span };
561+
let span = Span {
562+
ctxt: e.span.ctxt.apply_mark(self.ecx.current_expansion.mark),
563+
..DUMMY_SP
564+
};
563565
pats.push(self.ecx.pat_ident(span, name));
564566
for ref arg_ty in self.arg_unique_types[i].iter() {
565567
locals.push(Context::format_arg(self.ecx, self.macsp, e.span, arg_ty, name));

0 commit comments

Comments
 (0)