File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
compiler/rustc_codegen_cranelift/src/driver Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -179,8 +179,8 @@ fn load_imported_symbols_for_jit(tcx: TyCtxt<'_>) -> Vec<(String, *const u8)> {
179
179
let mut dylib_paths = Vec :: new ( ) ;
180
180
181
181
let crate_info = CrateInfo :: new ( tcx) ;
182
- let formats = tcx . dependency_formats ( ( ) ) ;
183
- let data = & formats
182
+ let data = & crate_info
183
+ . dependency_formats
184
184
. iter ( )
185
185
. find ( |( crate_type, _data) | * crate_type == rustc_session:: config:: CrateType :: Executable )
186
186
. unwrap ( )
@@ -190,7 +190,7 @@ fn load_imported_symbols_for_jit(tcx: TyCtxt<'_>) -> Vec<(String, *const u8)> {
190
190
match data[ cnum. as_usize ( ) - 1 ] {
191
191
Linkage :: NotLinked | Linkage :: IncludedFromDylib => { }
192
192
Linkage :: Static => {
193
- let name = tcx . crate_name ( cnum) ;
193
+ let name = & crate_info . crate_name [ & cnum] ;
194
194
let mut err =
195
195
tcx. sess . struct_err ( & format ! ( "Can't load static lib {}" , name. as_str( ) ) ) ;
196
196
err. note ( "rustc_codegen_cranelift can only load dylibs in JIT mode." ) ;
You can’t perform that action at this time.
0 commit comments