auto merge of #11184 : jhasse/rust/patch-col, r=huonw
This commit is contained in:
commit
b3b49d9873
2 changed files with 3 additions and 2 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
1
src/test/compile-fail/column-offset-1-based.rs
Normal file
1
src/test/compile-fail/column-offset-1-based.rs
Normal file
|
|
@ -0,0 +1 @@
|
|||
# //~ ERROR 1:1: 1:2 error: expected item
|
||||
Loading…
Add table
Add a link
Reference in a new issue