File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed
src/librustc_save_analysis Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -37,11 +37,18 @@ impl<'a> SpanUtils<'a> {
37
37
38
38
pub fn make_filename_string ( & self , file : & SourceFile ) -> String {
39
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 ( )
40
+ FileName :: Real ( path) if !file. name_was_remapped => {
41
+ if path. is_absolute ( ) {
42
+ self . sess . source_map ( ) . path_mapping ( )
43
+ . map_prefix ( path. clone ( ) ) . 0
44
+ . display ( )
45
+ . to_string ( )
46
+ } else {
47
+ self . sess . working_dir . 0
48
+ . join ( & path)
49
+ . display ( )
50
+ . to_string ( )
51
+ }
45
52
} ,
46
53
// If the file name is already remapped, we assume the user
47
54
// configured it the way they wanted to, so use that directly
You can’t perform that action at this time.
0 commit comments