From: Debian Rust Maintainers <pkg-rust-maintainers@alioth-lists.debian.net>
Date: Thu, 14 Jul 2022 13:17:39 +0200
Subject: d-bootstrap-custom-debuginfo-path

Forwarded: not-needed
===================================================================
---
 src/bootstrap/src/lib.rs                           | 22 ++--------------------
 .../remap_path_prefix/issue-73167-remap-std.rs     |  2 +-
 2 files changed, 3 insertions(+), 21 deletions(-)

diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs
index f44fe454..43ffe0e 100644
--- a/src/bootstrap/src/lib.rs
+++ b/src/bootstrap/src/lib.rs
@@ -1116,27 +1116,9 @@ impl Build {
 
         match which {
             GitRepo::Rustc => {
-                let sha = self.rust_sha().unwrap_or(&self.version);
-
-                match remap_scheme {
-                    RemapScheme::Compiler => {
-                        // For compiler sources, remap via `/rustc-dev/{sha}` to allow
-                        // distinguishing between compiler sources vs library sources, since
-                        // `rustc-dev` dist component places them under
-                        // `$sysroot/lib/rustlib/rustc-src/rust` as opposed to `rust-src`'s
-                        // `$sysroot/lib/rustlib/src/rust`.
-                        //
-                        // Keep this scheme in sync with `rustc_metadata::rmeta::decoder`'s
-                        // `try_to_translate_virtual_to_real`.
-                        Some(format!("/rustc-dev/{sha}"))
-                    }
-                    RemapScheme::NonCompiler => {
-                        // For non-compiler sources, use `/rustc/{sha}` remapping scheme.
-                        Some(format!("/rustc/{sha}"))
-                    }
-                }
+                Some(format!("/usr/src/rustc-{}", &self.version))
             }
-            GitRepo::Llvm => Some(String::from("/rustc/llvm")),
+            GitRepo::Llvm => panic!("GitRepo::Llvm unsupported on Debian"),
         }
     }
 
diff --git a/tests/codegen/remap_path_prefix/issue-73167-remap-std.rs b/tests/codegen/remap_path_prefix/issue-73167-remap-std.rs
index eb61016..9119c1d 100644
--- a/tests/codegen/remap_path_prefix/issue-73167-remap-std.rs
+++ b/tests/codegen/remap_path_prefix/issue-73167-remap-std.rs
@@ -7,7 +7,7 @@
 // true automatically. If paths to std library hasn't been remapped, we use the
 // above simulate-remapped-rust-src-base option to do it temporarily
 
-// CHECK: !DIFile(filename: "{{/rustc/.*/library/std/src/panic.rs}}"
+// CHECK: !DIFile(filename: "{{/usr/src/rustc-.*/library/std/src/panic.rs}}"
 fn main() {
     std::thread::spawn(|| {
         println!("hello");
