diff options
| author | Urgau <urgau@numericable.fr> | 2024-03-19 13:51:22 +0100 |
|---|---|---|
| committer | Urgau <urgau@numericable.fr> | 2024-03-28 18:47:26 +0100 |
| commit | d6a817a7d9b8950cf73914d17cfc1c8e35dc2c7f (patch) | |
| tree | ca1127b21e631e5cd06c72ed340e24c02a44d3e2 | |
| parent | 5de668acb07218424cbfe79f32f4961ca773570d (diff) | |
| download | rust-d6a817a7d9b8950cf73914d17cfc1c8e35dc2c7f.tar.gz rust-d6a817a7d9b8950cf73914d17cfc1c8e35dc2c7f.zip | |
Make local_crate_source_file return a RealFileName
so it can be remapped (or not) by callers
| -rw-r--r-- | src/debuginfo/mod.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/debuginfo/mod.rs b/src/debuginfo/mod.rs index c9f59ae9f29..222dc56a2b1 100644 --- a/src/debuginfo/mod.rs +++ b/src/debuginfo/mod.rs @@ -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), |
