Skip to content

Commit 79fe8af

Browse files
authored
Upgrade Rust toolchain to 2025-06-27 (#4182)
Relevant upstream PRs: - rust-lang/rust#141061 (Change __rust_no_alloc_shim_is_unstable to be a function) - rust-lang/rust#142650 (Refactor Translator) Resolves: #4176 By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.
1 parent 0024103 commit 79fe8af

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

kani-compiler/src/codegen_cprover_gotoc/codegen/foreign_function.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ lazy_static! {
3535
"__rust_alloc_zeroed".into(),
3636
"__rust_dealloc".into(),
3737
"__rust_realloc".into(),
38+
"__rust_no_alloc_shim_is_unstable_v2".into(),
3839
])
3940
};
4041
}

kani-compiler/src/session.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44
//! Module used to configure a compiler session.
55
66
use crate::args::Arguments;
7+
use rustc_driver::default_translator;
78
use rustc_errors::{
8-
ColorConfig, DiagInner, emitter::Emitter, emitter::HumanReadableErrorType,
9-
fallback_fluent_bundle, json::JsonEmitter, registry::Registry as ErrorRegistry,
9+
ColorConfig, DiagInner, emitter::Emitter, emitter::HumanReadableErrorType, json::JsonEmitter,
10+
registry::Registry as ErrorRegistry,
1011
};
1112
use rustc_session::EarlyDiagCtxt;
1213
use rustc_session::config::ErrorOutputType;
@@ -52,13 +53,11 @@ static JSON_PANIC_HOOK: LazyLock<Box<dyn Fn(&panic::PanicHookInfo<'_>) + Sync +
5253
panic::set_hook(Box::new(|info| {
5354
// Print stack trace.
5455
let msg = format!("Kani unexpectedly panicked at {info}.",);
55-
let fallback_bundle =
56-
fallback_fluent_bundle(rustc_driver::DEFAULT_LOCALE_RESOURCES.to_vec(), false);
5756
let mut emitter = JsonEmitter::new(
5857
Box::new(io::BufWriter::new(io::stderr())),
5958
#[allow(clippy::arc_with_non_send_sync)]
6059
Some(Arc::new(SourceMap::new(FilePathMapping::empty()))),
61-
fallback_bundle,
60+
default_translator(),
6261
false,
6362
HumanReadableErrorType::Default,
6463
ColorConfig::Never,

library/kani/kani_lib.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,3 +117,9 @@ uint8_t *__rust_realloc(uint8_t *ptr, size_t old_size, size_t align, size_t new_
117117

118118
return result;
119119
}
120+
121+
// Function required by the linker, see https://github.com/rust-lang/rust/pull/141061
122+
struct Unit __rust_no_alloc_shim_is_unstable_v2(void)
123+
{
124+
return VoidUnit;
125+
}

rust-toolchain.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
# SPDX-License-Identifier: Apache-2.0 OR MIT
33

44
[toolchain]
5-
channel = "nightly-2025-06-18"
5+
channel = "nightly-2025-06-27"
66
components = ["llvm-tools", "rustc-dev", "rust-src", "rustfmt"]

0 commit comments

Comments
 (0)