]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_save_analysis/src/span_utils.rs
Auto merge of #85178 - cjgillot:local-crate, r=oli-obk
[rust.git] / compiler / rustc_save_analysis / src / span_utils.rs
index bcda3a6d006f1f65f279cad6462b5badd027160d..1947b04f441c30025dad52f7152a5ad43fc17a09 100644 (file)
@@ -26,15 +26,15 @@ pub fn make_filename_string(&self, file: &SourceFile) -> String {
                         .display()
                         .to_string()
                 } else {
-                    self.sess.working_dir.stable_name().join(&path).display().to_string()
+                    self.sess
+                        .working_dir
+                        .remapped_path_if_available()
+                        .join(&path)
+                        .display()
+                        .to_string()
                 }
             }
-            // If the file name was remapped, we assume the user
-            // configured it the way they wanted to, so use that directly
-            FileName::Real(RealFileName::Remapped { local_path: _, virtual_name }) => {
-                virtual_name.display().to_string()
-            }
-            filename => filename.to_string(),
+            filename => filename.prefer_remapped().to_string(),
         }
     }