Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions compiler/rustc_metadata/src/rmeta/decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1669,15 +1669,14 @@ impl<'a> CrateMetadataRef<'a> {
for virtual_dir in virtual_source_base_dir.iter().flatten() {
if let Some(real_dir) = &real_source_base_dir
&& let rustc_span::FileName::Real(old_name) = name
&& let (_working_dir, embeddable_name) =
old_name.embeddable_name(RemapPathScopeComponents::MACRO)
&& let Ok(rest) = embeddable_name.strip_prefix(virtual_dir)
&& let virtual_path = old_name.path(RemapPathScopeComponents::MACRO)
&& let Ok(rest) = virtual_path.strip_prefix(virtual_dir)
{
let new_path = real_dir.join(rest);

debug!(
"try_to_translate_virtual_to_real: `{}` -> `{}`",
embeddable_name.display(),
virtual_path.display(),
new_path.display(),
);

Expand Down
10 changes: 2 additions & 8 deletions src/bootstrap/src/core/builder/cargo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1032,10 +1032,7 @@ impl Builder<'_> {
self.build.debuginfo_map_to(GitRepo::Rustc, RemapScheme::Compiler)
{
// When building compiler sources, we want to apply the compiler remap scheme.
cargo.env(
"RUSTC_DEBUGINFO_MAP",
format!("{}={}", self.build.src.display(), map_to),
);
cargo.env("RUSTC_DEBUGINFO_MAP", format!("compiler/={map_to}/compiler"));
cargo.env("CFG_VIRTUAL_RUSTC_DEV_SOURCE_BASE_DIR", map_to);
}
}
Expand All @@ -1047,10 +1044,7 @@ impl Builder<'_> {
if let Some(ref map_to) =
self.build.debuginfo_map_to(GitRepo::Rustc, RemapScheme::NonCompiler)
{
cargo.env(
"RUSTC_DEBUGINFO_MAP",
format!("{}={}", self.build.src.display(), map_to),
);
cargo.env("RUSTC_DEBUGINFO_MAP", format!("library/={map_to}/library"));
}
}
}
Expand Down
Loading