Skip to content

Commit a61a52b

Browse files
authored
Update toolchain to 2025-04-14 (model-checking#4018)
<strike>Keeping it as a draft till we figure out what's causing `tests/kani/FunctionContracts/modify_slice_elem.rs` to fail.</strike> Resolves model-checking#4009 Relevant upstream changes: - rust-lang/rust@9eca59a: Removes the option wrapper from `DefPathData::TypeNs`. - (Pointed out by @tautschnig) The combination of rust-lang/rust@78e9621390 and rust-lang/rust@aadfd810f6: these cause us to now assign a non-deterministic value when using contracts causing a spurious failure in `tests/kani/FunctionContracts/modify_slice_elem.rs`. We've made this a fixme test till we figure out a fix. 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 484cd30 commit a61a52b

File tree

5 files changed

+12
-11
lines changed

5 files changed

+12
-11
lines changed

kani-compiler/src/codegen_aeneas_llbc/mir_to_ullbc/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -813,7 +813,7 @@ impl<'a, 'tcx> Context<'a, 'tcx> {
813813
let disambiguator = CharonDisambiguator::new(data.disambiguator as usize);
814814
use rustc_hir::definitions::DefPathData;
815815
match &data.data {
816-
DefPathData::TypeNs(Some(symbol)) => {
816+
DefPathData::TypeNs(symbol) => {
817817
error_assert!(self, span, data.disambiguator == 0); // Sanity check
818818
name.push(CharonPathElem::Ident(symbol.to_string(), disambiguator));
819819
}
@@ -956,7 +956,7 @@ impl<'a, 'tcx> Context<'a, 'tcx> {
956956
let disambiguator = CharonDisambiguator::new(data.disambiguator as usize);
957957
use rustc_hir::definitions::DefPathData;
958958
match &data.data {
959-
DefPathData::TypeNs(Some(symbol)) => {
959+
DefPathData::TypeNs(symbol) => {
960960
error_assert!(self, span, data.disambiguator == 0); // Sanity check
961961
name.push(CharonPathElem::Ident(symbol.to_string(), disambiguator));
962962
}
@@ -1063,7 +1063,7 @@ impl<'a, 'tcx> Context<'a, 'tcx> {
10631063
let disambiguator = CharonDisambiguator::new(data.disambiguator as usize);
10641064
use rustc_hir::definitions::DefPathData;
10651065
match &data.data {
1066-
DefPathData::TypeNs(Some(symbol)) => {
1066+
DefPathData::TypeNs(symbol) => {
10671067
error_assert!(self, span, data.disambiguator == 0); // Sanity check
10681068
name.push(CharonPathElem::Ident(symbol.to_string(), disambiguator));
10691069
}

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-04-07"
5+
channel = "nightly-2025-04-14"
66
components = ["llvm-tools", "rustc-dev", "rust-src", "rustfmt"]

tests/expected/uninit/intrinsics/expected

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
std::ptr::read::<std::mem::MaybeUninit<u8>>.unsupported_construct.\
2-
- Status: FAILURE\
3-
- Description: "Interaction between raw pointers and unions is not yet supported."
4-
51
check_typed_swap_nonoverlapping.safety_check.\
62
- Status: FAILURE\
73
- Description: "Undefined Behavior: Reading from an uninitialized pointer of type `*mut u8`"

tests/kani/FunctionContracts/modify_slice_elem.rs renamed to tests/kani/FunctionContracts/modify_slice_elem_fixme.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
// SPDX-License-Identifier: Apache-2.0 OR MIT
33
//! Check that Kani correctly verifies the contract that modifies slices.
44
//!
5+
//! This started failing with the 2025-04-05 toolchain upgrade
6+
//! Tracking issue: https://github.com/model-checking/kani/issues/4029
7+
//!
58
//! Note that this test used to crash while parsing the annotations.
69
// kani-flags: -Zfunction-contracts
710
extern crate kani;

tests/perf/smol_str/src/lib.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@
55
//! <https://github.com/model-checking/kani/issues/3312>
66
77
#[kani::proof]
8-
#[kani::unwind(4)]
8+
#[kani::unwind(13)]
99
fn check_new() {
10-
let data: [char; 3] = kani::any();
11-
let input: String = data.iter().collect();
10+
let data: [u8; 12] = kani::any();
11+
let res = String::from_utf8(data.into());
12+
kani::assume(res.is_ok());
13+
let input: String = res.unwrap();
1214
smol_str::SmolStr::new(&input);
1315
}

0 commit comments

Comments
 (0)