Use correct spans for format string errors

When encountering format string errors in a raw string, or regular
string literal with embedded newlines, account for the positional
change to use correct spans.

:drive by fix: 🚗
This commit is contained in:
Esteban Küber
2018-07-19 23:14:00 -07:00
parent 154dee2dcc
commit f4306ffbfc
7 changed files with 123 additions and 21 deletions

View File

@@ -763,7 +763,7 @@ pub fn expand_preparsed_format_args(ecx: &mut ExtCtxt,
};
let fmt_str = &*fmt.node.0.as_str();
let mut parser = parse::Parser::new(fmt_str);
let mut parser = parse::Parser::new(fmt_str, fmt.node.1);
let mut pieces = vec![];
while let Some(mut piece) = parser.next() {