Make local_crate_source_file return a RealFileName
so it can be remapped (or not) by callers
This commit is contained in:
parent
106146fd95
commit
ee2898d3f1
5 changed files with 23 additions and 14 deletions
|
@ -99,9 +99,16 @@ impl DebugContext {
|
|||
FileNameDisplayPreference::Local
|
||||
})
|
||||
.into_owned();
|
||||
|
||||
let (name, file_info) = match tcx.sess.local_crate_source_file() {
|
||||
Some(path) => {
|
||||
let name = path.to_string_lossy().into_owned();
|
||||
let name = path
|
||||
.to_string_lossy(if should_remap_filepaths {
|
||||
FileNameDisplayPreference::Remapped
|
||||
} else {
|
||||
FileNameDisplayPreference::Local
|
||||
})
|
||||
.into_owned();
|
||||
(name, None)
|
||||
}
|
||||
None => (tcx.crate_name(LOCAL_CRATE).to_string(), None),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue