Skip to content

Commit 1498628

Browse files
committed
Use CrateInfo in load_imported_symbols_for_jit
1 parent bff4c9a commit 1498628

File tree

1 file changed

+3
-3
lines changed
  • compiler/rustc_codegen_cranelift/src/driver

1 file changed

+3
-3
lines changed

compiler/rustc_codegen_cranelift/src/driver/jit.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,8 @@ fn load_imported_symbols_for_jit(tcx: TyCtxt<'_>) -> Vec<(String, *const u8)> {
179179
let mut dylib_paths = Vec::new();
180180

181181
let crate_info = CrateInfo::new(tcx);
182-
let formats = tcx.dependency_formats(());
183-
let data = &formats
182+
let data = &crate_info
183+
.dependency_formats
184184
.iter()
185185
.find(|(crate_type, _data)| *crate_type == rustc_session::config::CrateType::Executable)
186186
.unwrap()
@@ -190,7 +190,7 @@ fn load_imported_symbols_for_jit(tcx: TyCtxt<'_>) -> Vec<(String, *const u8)> {
190190
match data[cnum.as_usize() - 1] {
191191
Linkage::NotLinked | Linkage::IncludedFromDylib => {}
192192
Linkage::Static => {
193-
let name = tcx.crate_name(cnum);
193+
let name = &crate_info.crate_name[&cnum];
194194
let mut err =
195195
tcx.sess.struct_err(&format!("Can't load static lib {}", name.as_str()));
196196
err.note("rustc_codegen_cranelift can only load dylibs in JIT mode.");

0 commit comments

Comments
 (0)