File tree 1 file changed +8
-12
lines changed
1 file changed +8
-12
lines changed Original file line number Diff line number Diff line change @@ -85,6 +85,8 @@ impl DebugContext {
85
85
let mut dwarf = DwarfUnit :: new ( encoding) ;
86
86
87
87
use rustc_session:: config:: RemapPathScopeComponents ;
88
+ use rustc_session:: RemapFileNameExt ;
89
+
88
90
let should_remap_filepaths =
89
91
tcx. sess . should_prefer_remapped ( RemapPathScopeComponents :: DEBUGINFO ) ;
90
92
@@ -93,22 +95,16 @@ impl DebugContext {
93
95
. sess
94
96
. opts
95
97
. working_dir
96
- . to_string_lossy ( if should_remap_filepaths {
97
- FileNameDisplayPreference :: Remapped
98
- } else {
99
- FileNameDisplayPreference :: Local
100
- } )
101
- . into_owned ( ) ;
98
+ . for_scope ( tcx. sess , RemapPathScopeComponents :: DEBUGINFO )
99
+ . to_string_lossy ( )
100
+ . to_string ( ) ;
102
101
103
102
let ( name, file_info) = match tcx. sess . local_crate_source_file ( ) {
104
103
Some ( path) => {
105
104
let name = path
106
- . to_string_lossy ( if should_remap_filepaths {
107
- FileNameDisplayPreference :: Remapped
108
- } else {
109
- FileNameDisplayPreference :: Local
110
- } )
111
- . into_owned ( ) ;
105
+ . for_scope ( tcx. sess , RemapPathScopeComponents :: DEBUGINFO )
106
+ . to_string_lossy ( )
107
+ . to_string ( ) ;
112
108
( name, None )
113
109
}
114
110
None => ( tcx. crate_name ( LOCAL_CRATE ) . to_string ( ) , None ) ,
You can’t perform that action at this time.
0 commit comments