Skip to content

Commit d6a817a

Browse files
committed
Make local_crate_source_file return a RealFileName
so it can be remapped (or not) by callers
1 parent 5de668a commit d6a817a

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/debuginfo/mod.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,16 @@ impl DebugContext {
9999
FileNameDisplayPreference::Local
100100
})
101101
.into_owned();
102+
102103
let (name, file_info) = match tcx.sess.local_crate_source_file() {
103104
Some(path) => {
104-
let name = path.to_string_lossy().into_owned();
105+
let name = path
106+
.to_string_lossy(if should_remap_filepaths {
107+
FileNameDisplayPreference::Remapped
108+
} else {
109+
FileNameDisplayPreference::Local
110+
})
111+
.into_owned();
105112
(name, None)
106113
}
107114
None => (tcx.crate_name(LOCAL_CRATE).to_string(), None),

0 commit comments

Comments
 (0)