Skip to content

Commit

Permalink
Upgrade toolchain to nightly-2024-11-13 (#3715)
Browse files Browse the repository at this point in the history
Resolves #3714 

rust-lang/rust@0a619dbc5d Pass owned
CodegenResults to link_binary

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 and MIT licenses.
  • Loading branch information
qinheping authored Nov 14, 2024
1 parent abcc9e1 commit b774d40
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 17 deletions.
13 changes: 5 additions & 8 deletions kani-compiler/src/codegen_aeneas_llbc/compiler_interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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: `<crate>.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);
Expand Down
12 changes: 4 additions & 8 deletions kani-compiler/src/codegen_cprover_gotoc/compiler_interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

0 comments on commit b774d40

Please sign in to comment.