Improve format string errors

- Point at format string position inside the formatting string
 - Explain that argument names can't start with an underscore
This commit is contained in:
Esteban Küber 2018-05-10 09:09:58 -07:00
parent e5f80f2a4f
commit 3f6b3bbace
5 changed files with 132 additions and 21 deletions

View file

@ -427,6 +427,13 @@ impl Span {
)
}
pub fn from_inner_byte_pos(self, start: usize, end: usize) -> Span {
let span = self.data();
Span::new(span.lo + BytePos::from_usize(start),
span.lo + BytePos::from_usize(end),
span.ctxt)
}
#[inline]
pub fn apply_mark(self, mark: Mark) -> Span {
let span = self.data();