File tree Expand file tree Collapse file tree 1 file changed +8
-12
lines changed Expand file tree Collapse file tree 1 file changed +8
-12
lines changed Original file line number Diff line number Diff line change @@ -85,6 +85,8 @@ impl DebugContext {
8585 let mut dwarf = DwarfUnit :: new ( encoding) ;
8686
8787 use rustc_session:: config:: RemapPathScopeComponents ;
88+ use rustc_session:: RemapFileNameExt ;
89+
8890 let should_remap_filepaths =
8991 tcx. sess . should_prefer_remapped ( RemapPathScopeComponents :: DEBUGINFO ) ;
9092
@@ -93,22 +95,16 @@ impl DebugContext {
9395 . sess
9496 . opts
9597 . 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 ( ) ;
102101
103102 let ( name, file_info) = match tcx. sess . local_crate_source_file ( ) {
104103 Some ( path) => {
105104 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 ( ) ;
112108 ( name, None )
113109 }
114110 None => ( tcx. crate_name ( LOCAL_CRATE ) . to_string ( ) , None ) ,
You can’t perform that action at this time.
0 commit comments