Skip to content

Commit

Permalink
format!: use a dummy span rather than callee span for the span base f…
Browse files Browse the repository at this point in the history
…or temporary variables
  • Loading branch information
nrc committed Jul 28, 2017
1 parent e1206c4 commit bbc00c9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/libsyntax_ext/format.rs
Expand Up @@ -20,7 +20,7 @@ use syntax::ext::build::AstBuilder;
use syntax::parse::token;
use syntax::ptr::P;
use syntax::symbol::{Symbol, keywords};
use syntax_pos::Span;
use syntax_pos::{Span, DUMMY_SP};
use syntax::tokenstream;

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

0 comments on commit bbc00c9

Please sign in to comment.