We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 24123dd commit 3ceae8dCopy full SHA for 3ceae8d
src/librustc_save_analysis/span_utils.rs
@@ -37,11 +37,18 @@ impl<'a> SpanUtils<'a> {
37
38
pub fn make_filename_string(&self, file: &SourceFile) -> String {
39
match &file.name {
40
- FileName::Real(path) if !path.is_absolute() && !file.name_was_remapped => {
41
- self.sess.working_dir.0
42
- .join(&path)
43
- .display()
44
- .to_string()
+ FileName::Real(path) if !file.name_was_remapped => {
+ if path.is_absolute() {
+ self.sess.source_map().path_mapping()
+ .map_prefix(path.clone()).0
+ .display()
45
+ .to_string()
46
+ } else {
47
+ self.sess.working_dir.0
48
+ .join(&path)
49
50
51
+ }
52
},
53
// If the file name is already remapped, we assume the user
54
// configured it the way they wanted to, so use that directly
0 commit comments