about summary refs log tree commit diff
path: root/compiler/rustc_codegen_cranelift/src/debuginfo/line_info.rs
diff options
context:
space:
mode:
authorUrgau <urgau@numericable.fr>2024-03-22 15:27:17 +0100
committerUrgau <urgau@numericable.fr>2024-03-28 18:47:26 +0100
commitfefb8f1f9cb830e1ca0b0ba449db7c8e7d4ff7ba (patch)
treeb768c3b57ac8013ca10494c76b2a5ad85f9908b1 /compiler/rustc_codegen_cranelift/src/debuginfo/line_info.rs
parent4f4fa42b0ee1cf6c988d3f7ed6bcb4a51e788282 (diff)
downloadrust-fefb8f1f9cb830e1ca0b0ba449db7c8e7d4ff7ba.tar.gz
rust-fefb8f1f9cb830e1ca0b0ba449db7c8e7d4ff7ba.zip
Replace Session should_remap_filepaths with filename_display_preference
Diffstat (limited to 'compiler/rustc_codegen_cranelift/src/debuginfo/line_info.rs')
-rw-r--r--compiler/rustc_codegen_cranelift/src/debuginfo/line_info.rs15
1 files changed, 2 insertions, 13 deletions
diff --git a/compiler/rustc_codegen_cranelift/src/debuginfo/line_info.rs b/compiler/rustc_codegen_cranelift/src/debuginfo/line_info.rs
index 380eba437c2..32b9c824ded 100644
--- a/compiler/rustc_codegen_cranelift/src/debuginfo/line_info.rs
+++ b/compiler/rustc_codegen_cranelift/src/debuginfo/line_info.rs
@@ -89,11 +89,7 @@ impl DebugContext {
             match &source_file.name {
                 FileName::Real(path) => {
                     let (dir_path, file_name) =
-                        split_path_dir_and_file(if self.should_remap_filepaths {
-                            path.remapped_path_if_available()
-                        } else {
-                            path.local_path_if_available()
-                        });
+                        split_path_dir_and_file(path.to_path(self.filename_display_preference));
                     let dir_name = osstr_as_utf8_bytes(dir_path.as_os_str());
                     let file_name = osstr_as_utf8_bytes(file_name);
 
@@ -115,14 +111,7 @@ impl DebugContext {
                 filename => {
                     let dir_id = line_program.default_directory();
                     let dummy_file_name = LineString::new(
-                        filename
-                            .display(if self.should_remap_filepaths {
-                                FileNameDisplayPreference::Remapped
-                            } else {
-                                FileNameDisplayPreference::Local
-                            })
-                            .to_string()
-                            .into_bytes(),
+                        filename.display(self.filename_display_preference).to_string().into_bytes(),
                         line_program.encoding(),
                         line_strings,
                     );