about summary refs log tree commit diff
path: root/compiler/rustc_span/src/source_map.rs
diff options
context:
space:
mode:
authorAndy Wang <cbeuw.andy@gmail.com>2021-04-19 23:27:02 +0100
committerAndy Wang <cbeuw.andy@gmail.com>2021-05-05 15:31:28 +0100
commit5417b45c2676dcd396f007bd89ed0cd55d085768 (patch)
tree25a9819f523855d604aa373edb93c850f817532f /compiler/rustc_span/src/source_map.rs
parentfb4f6439f62d4b940bdfab3f78771d76eacab379 (diff)
downloadrust-5417b45c2676dcd396f007bd89ed0cd55d085768.tar.gz
rust-5417b45c2676dcd396f007bd89ed0cd55d085768.zip
Use local and remapped paths where appropriate
Diffstat (limited to 'compiler/rustc_span/src/source_map.rs')
-rw-r--r--compiler/rustc_span/src/source_map.rs7
1 files changed, 1 insertions, 6 deletions
diff --git a/compiler/rustc_span/src/source_map.rs b/compiler/rustc_span/src/source_map.rs
index 4e60d071c68..82e6c579be4 100644
--- a/compiler/rustc_span/src/source_map.rs
+++ b/compiler/rustc_span/src/source_map.rs
@@ -369,11 +369,6 @@ impl SourceMap {
         source_file
     }
 
-    pub fn mk_substr_filename(&self, sp: Span) -> String {
-        let pos = self.lookup_char_pos(sp.lo());
-        format!("<{}:{}:{}>", pos.file.name, pos.line, pos.col.to_usize() + 1)
-    }
-
     // If there is a doctest offset, applies it to the line.
     pub fn doctest_offset_line(&self, file: &FileName, orig: usize) -> usize {
         match file {
@@ -420,7 +415,7 @@ impl SourceMap {
         let hi = self.lookup_char_pos(sp.hi());
         format!(
             "{}:{}:{}: {}:{}",
-            lo.file.name,
+            lo.file.name.prefer_remapped(),
             lo.line,
             lo.col.to_usize() + 1,
             hi.line,