Skip to content

Commit 42190bb

Browse files
committed
Remove redundant path join
1 parent 95fd357 commit 42190bb

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs

+4-7
Original file line numberDiff line numberDiff line change
@@ -1055,14 +1055,11 @@ pub fn compile_unit_metadata(
10551055
let work_dir = tcx.sess.opts.working_dir.to_string_lossy(FileNameDisplayPreference::Remapped);
10561056
let flags = "\0";
10571057
let output_filenames = tcx.output_filenames(());
1058-
let out_dir = &output_filenames.out_directory;
10591058
let split_name = if tcx.sess.target_can_use_split_dwarf() {
1060-
output_filenames.split_dwarf_path(tcx.sess.split_debuginfo(), Some(codegen_unit_name)).map(
1061-
|f| {
1062-
let joined = out_dir.join(f);
1063-
tcx.sess.source_map().path_mapping().map_prefix(joined).0
1064-
},
1065-
)
1059+
output_filenames
1060+
.split_dwarf_path(tcx.sess.split_debuginfo(), Some(codegen_unit_name))
1061+
// We get a path relative to the working directory from split_dwarf_path
1062+
.map(|f| tcx.sess.source_map().path_mapping().map_prefix(f).0)
10661063
} else {
10671064
None
10681065
}

0 commit comments

Comments
 (0)