about summary refs log tree commit diff
path: root/compiler/rustc_codegen_cranelift
diff options
context:
space:
mode:
authorDianQK <dianqk@dianqk.net>2024-12-20 21:47:00 +0800
committerGitHub <noreply@github.com>2024-12-20 21:47:00 +0800
commit350e7f858e6a1cf56bfc99dd8cd4ef7fc4558485 (patch)
tree8dc090711d5a7e672c4e1f37cc1c0a6c2370fa66 /compiler/rustc_codegen_cranelift
parent1652e3a56073b81f4c990f9c560dbbbab288d4ef (diff)
parent0daa921f0e95acef303f3c091a09d667f9b63405 (diff)
downloadrust-350e7f858e6a1cf56bfc99dd8cd4ef7fc4558485.tar.gz
rust-350e7f858e6a1cf56bfc99dd8cd4ef7fc4558485.zip
Rollup merge of #134514 - bjorn3:more_driver_refactors, r=jieyouxu
Improve dependency_format a bit

* Make `DependencyList` an `IndexVec` rather than emulating one using a `Vec` (which was off-by-one as LOCAL_CRATE was intentionally skipped)
* Update some comments for the fact that we now use `#[global_allocator]` rather than `extern crate alloc_system;`/`extern crate alloc_jemalloc;` for specifying which allocator to use. We still use a similar mechanism for the panic runtime, so refer to the panic runtime in those comments instead.
* An unrelated refactor to `create_and_enter_global_ctxt` I forgot to include in https://github.com/rust-lang/rust/pull/134302. This refactor is too small to be worth it's own PR.
Diffstat (limited to 'compiler/rustc_codegen_cranelift')
-rw-r--r--compiler/rustc_codegen_cranelift/src/driver/jit.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_cranelift/src/driver/jit.rs b/compiler/rustc_codegen_cranelift/src/driver/jit.rs
index 4be4291021d..eaab3362c7e 100644
--- a/compiler/rustc_codegen_cranelift/src/driver/jit.rs
+++ b/compiler/rustc_codegen_cranelift/src/driver/jit.rs
@@ -294,7 +294,7 @@ fn dep_symbol_lookup_fn(
     // search path.
     for &cnum in crate_info.used_crates.iter().rev() {
         let src = &crate_info.used_crate_source[&cnum];
-        match data[cnum.as_usize() - 1] {
+        match data[cnum] {
             Linkage::NotLinked | Linkage::IncludedFromDylib => {}
             Linkage::Static => {
                 let name = crate_info.crate_name[&cnum];