From 3d43543c2104d6592e2a0e879d75cf27208be0c5 Mon Sep 17 00:00:00 2001 From: Jan Niklas Hasse Date: Sat, 28 Dec 2013 23:23:44 +0100 Subject: Output columns 1-based. Fixes #10848 --- src/libsyntax/codemap.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/libsyntax') diff --git a/src/libsyntax/codemap.rs b/src/libsyntax/codemap.rs index 97d3db074bb..fffcae0bde3 100644 --- a/src/libsyntax/codemap.rs +++ b/src/libsyntax/codemap.rs @@ -308,7 +308,7 @@ impl CodeMap { 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 @@ impl CodeMap { 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 { -- cgit 1.4.1-3-g733a5