]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_span/src/source_map.rs
Use local and remapped paths where appropriate
[rust.git] / compiler / rustc_span / src / source_map.rs
index 4e60d071c687337b2a070dbc66c586a3b4b1bae6..82e6c579be4fb4ce645543f734bd6c0121836dda 100644 (file)
@@ -369,11 +369,6 @@ pub fn new_imported_source_file(
         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 @@ pub fn span_to_string(&self, sp: Span) -> String {
         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,