diff --git a/kani-compiler/src/codegen_aeneas_llbc/compiler_interface.rs b/kani-compiler/src/codegen_aeneas_llbc/compiler_interface.rs index 9f4365b194b2..0cccda92f3b7 100644 --- a/kani-compiler/src/codegen_aeneas_llbc/compiler_interface.rs +++ b/kani-compiler/src/codegen_aeneas_llbc/compiler_interface.rs @@ -326,19 +326,16 @@ impl CodegenBackend for LlbcCodegenBackend { codegen_results: CodegenResults, outputs: &OutputFilenames, ) -> Result<(), ErrorGuaranteed> { - let requested_crate_types = &codegen_results.crate_info.crate_types; + let requested_crate_types = &codegen_results.crate_info.crate_types.clone(); + let local_crate_name = codegen_results.crate_info.local_crate_name; + let link_result = link_binary(sess, &ArArchiveBuilderBuilder, codegen_results, outputs); for crate_type in requested_crate_types { - let out_fname = out_filename( - sess, - *crate_type, - outputs, - codegen_results.crate_info.local_crate_name, - ); + let out_fname = out_filename(sess, *crate_type, outputs, local_crate_name); let out_path = out_fname.as_path(); debug!(?crate_type, ?out_path, "link"); if *crate_type == CrateType::Rlib { // Emit the `rlib` that contains just one file: `.rmeta` - link_binary(sess, &ArArchiveBuilderBuilder, &codegen_results, outputs)? + link_result? } else { // Write the location of the kani metadata file in the requested compiler output file. let base_filepath = outputs.path(OutputType::Object); diff --git a/kani-compiler/src/codegen_cprover_gotoc/compiler_interface.rs b/kani-compiler/src/codegen_cprover_gotoc/compiler_interface.rs index 9da07e36bdf4..3935be784311 100644 --- a/kani-compiler/src/codegen_cprover_gotoc/compiler_interface.rs +++ b/kani-compiler/src/codegen_cprover_gotoc/compiler_interface.rs @@ -409,22 +409,18 @@ impl CodegenBackend for GotocCodegenBackend { codegen_results: CodegenResults, outputs: &OutputFilenames, ) -> Result<(), ErrorGuaranteed> { - let requested_crate_types = &codegen_results.crate_info.crate_types; + let requested_crate_types = &codegen_results.crate_info.crate_types.clone(); + let local_crate_name = codegen_results.crate_info.local_crate_name; // Create the rlib if one was requested. if requested_crate_types.iter().any(|crate_type| *crate_type == CrateType::Rlib) { - link_binary(sess, &ArArchiveBuilderBuilder, &codegen_results, outputs)?; + link_binary(sess, &ArArchiveBuilderBuilder, codegen_results, outputs)?; } // But override all the other outputs. // Note: Do this after `link_binary` call, since it may write to the object files // and override the json we are creating. for crate_type in requested_crate_types { - let out_fname = out_filename( - sess, - *crate_type, - outputs, - codegen_results.crate_info.local_crate_name, - ); + let out_fname = out_filename(sess, *crate_type, outputs, local_crate_name); let out_path = out_fname.as_path(); debug!(?crate_type, ?out_path, "link"); if *crate_type != CrateType::Rlib { diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 2df39d2a3931..4b99432e755f 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -2,5 +2,5 @@ # SPDX-License-Identifier: Apache-2.0 OR MIT [toolchain] -channel = "nightly-2024-11-12" +channel = "nightly-2024-11-13" components = ["llvm-tools", "rustc-dev", "rust-src", "rustfmt"]