Skip to content
Closed
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
22 changes: 0 additions & 22 deletions compiler/rustc_metadata/src/rmeta/decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1772,17 +1772,6 @@ impl<'a> CrateMetadataRef<'a> {
&mut name,
);

// If this file is under $sysroot/lib/rustlib/rustc-src/
// and the user wish to simulate remapping with -Z simulate-remapped-rust-src-base,
// then we change `name` to a similar state as if the rust was bootstrapped
// with `remap-debuginfo = true`.
try_to_translate_real_to_virtual(
option_env!("CFG_VIRTUAL_RUSTC_DEV_SOURCE_BASE_DIR"),
&tcx.sess.opts.real_rustc_dev_source_base_dir,
"compiler",
&mut name,
);

// If this file's path has been remapped to `/rustc/$hash`,
// we might be able to reverse that.
//
Expand All @@ -1794,17 +1783,6 @@ impl<'a> CrateMetadataRef<'a> {
&mut name,
);

// If this file's path has been remapped to `/rustc-dev/$hash`,
// we might be able to reverse that.
//
// NOTE: if you update this, you might need to also update bootstrap's code for generating
// the `rustc-dev` component in `Src::run` in `src/bootstrap/dist.rs`.
try_to_translate_virtual_to_real(
option_env!("CFG_VIRTUAL_RUSTC_DEV_SOURCE_BASE_DIR"),
&tcx.sess.opts.real_rustc_dev_source_base_dir,
&mut name,
);

let local_version = tcx.sess.source_map().new_imported_source_file(
name,
src_hash,
Expand Down
6 changes: 1 addition & 5 deletions src/bootstrap/src/core/builder/cargo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1029,10 +1029,9 @@ impl Builder<'_> {
}

// `rustc` needs to know the remapping scheme, in order to know how to reverse it (unremap)
// later. Two env vars are set and made available to the compiler
// later. The following env var is set and made available to the compiler:
//
// - `CFG_VIRTUAL_RUST_SOURCE_BASE_DIR`: `rust-src` remap scheme (`NonCompiler`)
// - `CFG_VIRTUAL_RUSTC_DEV_SOURCE_BASE_DIR`: `rustc-dev` remap scheme (`Compiler`)
//
// Keep this scheme in sync with `rustc_metadata::rmeta::decoder`'s
// `try_to_translate_virtual_to_real`.
Expand All @@ -1051,9 +1050,6 @@ impl Builder<'_> {
if let Some(ref map_to) =
self.build.debuginfo_map_to(GitRepo::Rustc, RemapScheme::Compiler)
{
// Tell the compiler which prefix was used for remapping the compiler it-self
cargo.env("CFG_VIRTUAL_RUSTC_DEV_SOURCE_BASE_DIR", map_to);

// When building compiler sources, we want to apply the compiler remap scheme.
let map = [
// Cargo use relative paths for workspace members, so let's remap those.
Expand Down
Loading