about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUrgau <urgau@numericable.fr>2025-06-10 23:35:49 +0200
committerUrgau <urgau@numericable.fr>2025-06-11 07:42:58 +0200
commit208f2e461c19ca62bc43e8797728bbc7308b05ba (patch)
tree66cd5b39e70a02267c0834dd064e3dd7a5cd7026
parentc6a955468b025dbe3d1de3e8f3e30496d1fb7f40 (diff)
downloadrust-208f2e461c19ca62bc43e8797728bbc7308b05ba.tar.gz
rust-208f2e461c19ca62bc43e8797728bbc7308b05ba.zip
Remove useless and wrong std crates special casing when un-remap sysroot
-rw-r--r--compiler/rustc_metadata/src/rmeta/decoder.rs29
1 files changed, 1 insertions, 28 deletions
diff --git a/compiler/rustc_metadata/src/rmeta/decoder.rs b/compiler/rustc_metadata/src/rmeta/decoder.rs
index 1dae858b7ef..1953eef8170 100644
--- a/compiler/rustc_metadata/src/rmeta/decoder.rs
+++ b/compiler/rustc_metadata/src/rmeta/decoder.rs
@@ -1649,34 +1649,7 @@ impl<'a> CrateMetadataRef<'a> {
                         old_name
                     && let Ok(rest) = virtual_name.strip_prefix(virtual_dir)
                 {
-                    // The std library crates are in
-                    // `$sysroot/lib/rustlib/src/rust/library`, whereas other crates
-                    // may be in `$sysroot/lib/rustlib/src/rust/` directly. So we
-                    // detect crates from the std libs and handle them specially.
-                    const STD_LIBS: &[&str] = &[
-                        "core",
-                        "alloc",
-                        "std",
-                        "test",
-                        "term",
-                        "unwind",
-                        "proc_macro",
-                        "panic_abort",
-                        "panic_unwind",
-                        "profiler_builtins",
-                        "rtstartup",
-                        "rustc-std-workspace-core",
-                        "rustc-std-workspace-alloc",
-                        "rustc-std-workspace-std",
-                        "backtrace",
-                    ];
-                    let is_std_lib = STD_LIBS.iter().any(|l| rest.starts_with(l));
-
-                    let new_path = if is_std_lib {
-                        real_dir.join("library").join(rest)
-                    } else {
-                        real_dir.join(rest)
-                    };
+                    let new_path = real_dir.join(rest);
 
                     debug!(
                         "try_to_translate_virtual_to_real: `{}` -> `{}`",