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 | ee2898d3f1cbece34153581823fafa7f572bbff0 (patch) | |
| tree | 6adcd3647b91cae40dcd75cf670f17b1a0267170 /compiler/rustc_codegen_cranelift/src/debuginfo | |
| parent | 106146fd958c3c0d3428cfc7be1f75c5bc81698f (diff) | |
| download | rust-ee2898d3f1cbece34153581823fafa7f572bbff0.tar.gz rust-ee2898d3f1cbece34153581823fafa7f572bbff0.zip | |
Make local_crate_source_file return a RealFileName
so it can be remapped (or not) by callers
Diffstat (limited to 'compiler/rustc_codegen_cranelift/src/debuginfo')
| -rw-r--r-- | compiler/rustc_codegen_cranelift/src/debuginfo/mod.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_cranelift/src/debuginfo/mod.rs b/compiler/rustc_codegen_cranelift/src/debuginfo/mod.rs index c9f59ae9f29..222dc56a2b1 100644 --- a/compiler/rustc_codegen_cranelift/src/debuginfo/mod.rs +++ b/compiler/rustc_codegen_cranelift/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), |
