Skip to content
Merged
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
8 changes: 4 additions & 4 deletions src/libsyntax/codemap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -317,10 +317,10 @@ impl CodeMap {

pub fn mk_substr_filename(&self, sp: Span) -> String {
let pos = self.lookup_char_pos(sp.lo());
(format!("<{}:{}:{}>",
format!("<{}:{}:{}>",
pos.file.name,
pos.line,
pos.col.to_usize() + 1)).to_string()
pos.col.to_usize() + 1)
}

// If there is a doctest_offset, apply it to the line
Expand Down Expand Up @@ -462,12 +462,12 @@ impl CodeMap {

let lo = self.lookup_char_pos_adj(sp.lo());
let hi = self.lookup_char_pos_adj(sp.hi());
return (format!("{}:{}:{}: {}:{}",
format!("{}:{}:{}: {}:{}",
lo.filename,
lo.line,
lo.col.to_usize() + 1,
hi.line,
hi.col.to_usize() + 1)).to_string()
hi.col.to_usize() + 1)
}

pub fn span_to_filename(&self, sp: Span) -> FileName {
Expand Down