Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/libsyntax/codemap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions src/test/compile-fail/column-offset-1-based.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# //~ ERROR 1:1: 1:2 error: expected item