]> git.lizzy.rs Git - rust.git/commitdiff
Output columns 1-based. Fixes #10848
authorJan Niklas Hasse <jhasse@gmail.com>
Sat, 28 Dec 2013 22:23:44 +0000 (23:23 +0100)
committerJan Niklas Hasse <jhasse@gmail.com>
Thu, 2 Jan 2014 01:07:21 +0000 (02:07 +0100)
src/libsyntax/codemap.rs

index 97d3db074bb00f3be24836771a573554747c4639..fffcae0bde3819dc0c05722f00c57ec8d9416770 100644 (file)
@@ -308,7 +308,7 @@ pub fn new_filemap_w_substr(&self,
     pub fn mk_substr_filename(&self, sp: Span) -> ~str {
         let pos = self.lookup_char_pos(sp.lo);
         return format!("<{}:{}:{}>", pos.file.name,
-                    pos.line, pos.col.to_uint());
+                       pos.line, pos.col.to_uint() + 1)
     }
 
     /// Lookup source information about a BytePos
@@ -354,7 +354,7 @@ pub fn span_to_str(&self, sp: Span) -> ~str {
         let lo = self.lookup_char_pos_adj(sp.lo);
         let hi = self.lookup_char_pos_adj(sp.hi);
         return format!("{}:{}:{}: {}:{}", lo.filename,
-                    lo.line, lo.col.to_uint(), hi.line, hi.col.to_uint())
+                       lo.line, lo.col.to_uint() + 1, hi.line, hi.col.to_uint() + 1)
     }
 
     pub fn span_to_filename(&self, sp: Span) -> FileName {