@@ -283,12 +283,7 @@ impl CodegenBackend for GotocCodegenBackend {
283
283
}
284
284
}
285
285
286
- fn codegen_crate (
287
- & self ,
288
- tcx : TyCtxt ,
289
- rustc_metadata : EncodedMetadata ,
290
- _need_metadata_module : bool ,
291
- ) -> Box < dyn Any > {
286
+ fn codegen_crate ( & self , tcx : TyCtxt ) -> Box < dyn Any > {
292
287
let ret_val = rustc_internal:: run ( tcx, || {
293
288
super :: utils:: init ( ) ;
294
289
@@ -414,7 +409,7 @@ impl CodegenBackend for GotocCodegenBackend {
414
409
) ;
415
410
}
416
411
}
417
- codegen_results ( tcx, rustc_metadata , & results. machine_model )
412
+ codegen_results ( tcx, & results. machine_model )
418
413
} ) ;
419
414
ret_val. unwrap ( )
420
415
}
@@ -440,12 +435,18 @@ impl CodegenBackend for GotocCodegenBackend {
440
435
/// For other crate types, we stub the file requested by writing the
441
436
/// path of the `kani-metadata.json` file so `kani-driver` can safely find the latest metadata.
442
437
/// See <https://github.com/model-checking/kani/issues/2234> for more details.
443
- fn link ( & self , sess : & Session , codegen_results : CodegenResults , outputs : & OutputFilenames ) {
438
+ fn link (
439
+ & self ,
440
+ sess : & Session ,
441
+ codegen_results : CodegenResults ,
442
+ rustc_metadata : EncodedMetadata ,
443
+ outputs : & OutputFilenames ,
444
+ ) {
444
445
let requested_crate_types = & codegen_results. crate_info . crate_types . clone ( ) ;
445
446
let local_crate_name = codegen_results. crate_info . local_crate_name ;
446
447
// Create the rlib if one was requested.
447
448
if requested_crate_types. contains ( & CrateType :: Rlib ) {
448
- link_binary ( sess, & ArArchiveBuilderBuilder , codegen_results, outputs) ;
449
+ link_binary ( sess, & ArArchiveBuilderBuilder , codegen_results, rustc_metadata , outputs) ;
449
450
}
450
451
451
452
// But override all the other outputs.
@@ -541,18 +542,12 @@ fn check_options(session: &Session) {
541
542
}
542
543
543
544
/// Return a struct that contains information about the codegen results as expected by `rustc`.
544
- fn codegen_results (
545
- tcx : TyCtxt ,
546
- rustc_metadata : EncodedMetadata ,
547
- machine : & MachineModel ,
548
- ) -> Box < dyn Any > {
545
+ fn codegen_results ( tcx : TyCtxt , machine : & MachineModel ) -> Box < dyn Any > {
549
546
let work_products = FxIndexMap :: < WorkProductId , WorkProduct > :: default ( ) ;
550
547
Box :: new ( (
551
548
CodegenResults {
552
549
modules : vec ! [ ] ,
553
550
allocator_module : None ,
554
- metadata_module : None ,
555
- metadata : rustc_metadata,
556
551
crate_info : CrateInfo :: new ( tcx, machine. architecture . clone ( ) ) ,
557
552
} ,
558
553
work_products,
0 commit comments