diff options
| author | bors <bors@rust-lang.org> | 2018-02-17 14:31:32 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2018-02-17 14:31:32 +0000 |
| commit | f6216b2d556afba2fdab906409582cb5471eafe0 (patch) | |
| tree | e7e19978566964b0def4552fdcb0e8f454b48d69 /src/libsyntax | |
| parent | b298607864b76ea6b7b7a4b8bb482472f1604c8d (diff) | |
| parent | 47db61a3c39da4066cb0b5fa83ddb36e649df7f5 (diff) | |
| download | rust-f6216b2d556afba2fdab906409582cb5471eafe0.tar.gz rust-f6216b2d556afba2fdab906409582cb5471eafe0.zip | |
Auto merge of #48294 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 8 pull requests - Successful merges: #48095, #48152, #48234, #48239, #48243, #48260, #48284, #48286 - Failed merges:
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/codemap.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libsyntax/codemap.rs b/src/libsyntax/codemap.rs index ff6f32fc3be..df5845f6c21 100644 --- a/src/libsyntax/codemap.rs +++ b/src/libsyntax/codemap.rs @@ -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 @@ -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 { |
