Skip to content

Commit 5a18cbf

Browse files
btjtautschnig
authored andcommitted
Bump VeriFast to 25.11; fixes failure
1 parent 8da6f6e commit 5a18cbf

File tree

4 files changed

+37
-38
lines changed

4 files changed

+37
-38
lines changed

.github/workflows/verifast-negative.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,16 @@ jobs:
3030
- name: Install VeriFast
3131
run: |
3232
cd ~
33-
curl -OL https://github.com/verifast/verifast/releases/download/25.08/verifast-25.08-linux.tar.gz
34-
# https://github.com/verifast/verifast/attestations/10123891
35-
echo '1e40019d6add91bf72141c86f4007f2fe1eef67f453cb7fb8f1f5ab7d31d509f verifast-25.08-linux.tar.gz' | shasum -a 256 -c
36-
tar xf verifast-25.08-linux.tar.gz
33+
curl -OL https://github.com/verifast/verifast/releases/download/25.11/verifast-25.11-linux.tar.gz
34+
# https://github.com/verifast/verifast/attestations/14103492
35+
echo '990c3cadba7cfc9ef9c19d5f1ff039fd746155164fe4a5ec365c625182400f3e verifast-25.11-linux.tar.gz' | shasum -a 256 -c
36+
tar xf verifast-25.11-linux.tar.gz
3737
3838
- name: Install the Rust toolchain used by VeriFast
39-
run: rustup toolchain install nightly-2025-04-09
39+
run: rustup toolchain install nightly-2025-10-09
4040

4141
- name: Run VeriFast Verification
4242
run: |
43-
export PATH=~/verifast-25.08/bin:$PATH
43+
export PATH=~/verifast-25.11/bin:$PATH
4444
cd verifast-proofs
4545
bash check-verifast-proofs-negative.sh

.github/workflows/verifast.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,17 @@ jobs:
2727
- name: Install VeriFast
2828
run: |
2929
cd ~
30-
curl -OL https://github.com/verifast/verifast/releases/download/25.08/verifast-25.08-linux.tar.gz
31-
# https://github.com/verifast/verifast/attestations/10123891
32-
echo '1e40019d6add91bf72141c86f4007f2fe1eef67f453cb7fb8f1f5ab7d31d509f verifast-25.08-linux.tar.gz' | shasum -a 256 -c
33-
tar xf verifast-25.08-linux.tar.gz
30+
curl -OL https://github.com/verifast/verifast/releases/download/25.11/verifast-25.11-linux.tar.gz
31+
# https://github.com/verifast/verifast/attestations/14103492
32+
echo '990c3cadba7cfc9ef9c19d5f1ff039fd746155164fe4a5ec365c625182400f3e verifast-25.11-linux.tar.gz' | shasum -a 256 -c
33+
tar xf verifast-25.11-linux.tar.gz
3434
3535
- name: Install the Rust toolchain used by VeriFast
36-
run: rustup toolchain install nightly-2025-04-09
36+
run: rustup toolchain install nightly-2025-10-09
3737

3838
- name: Run VeriFast Verification
3939
run: |
40-
export PATH=~/verifast-25.08/bin:$PATH
40+
export PATH=~/verifast-25.11/bin:$PATH
4141
cd verifast-proofs
4242
bash check-verifast-proofs.sh
4343

verifast-proofs/alloc/collections/linked_list.rs/verified/linked_list.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ pred Nodes1<T>(alloc_id: alloc_id_t, n: Option<NonNull<Node<T>>>, prev: Option<N
363363
nexts == cons(next0, nexts0)
364364
};
365365
366-
lem_auto Nodes1_inv<T>()
366+
lem_auto Nodes1_inv<T: ?Sized>()
367367
req [?f]Nodes1::<T>(?alloc_id, ?head, ?prev, ?last, ?next, ?nodes, ?prevs, ?nexts);
368368
ens [f]Nodes1::<T>(alloc_id, head, prev, last, next, nodes, prevs, nexts) &*& length(prevs) == length(nodes) &*& length(nexts) == length(nodes);
369369
{
@@ -1089,7 +1089,8 @@ impl<T, A: Allocator> LinkedList<T, A> {
10891089
//@ assert std::boxed::Box_minus_contents_in(_, _, _, _, _, ?contents_ptr);
10901090
//@ assume(alloc_id.lft == 'static);
10911091
//@ produce_lifetime_token_static();
1092-
//@ open_points_to_at_lft(contents_ptr);
1092+
//@ assert [?qstatic]lifetime_token('static);
1093+
//@ open_points_to_at_lft(contents_ptr, qstatic);
10931094
*head_ref = node.next;
10941095
//@ close_points_to_at_lft(contents_ptr);
10951096
//@ std::boxed::Box_unseparate_contents(&node_1);
@@ -2147,7 +2148,8 @@ impl<T, A: Allocator> LinkedList<T, A> {
21472148
//@ assert Allocator(_, _, ?alloc_id);
21482149
//@ assume(alloc_id.lft == 'static);
21492150
//@ produce_lifetime_token_static();
2150-
//@ open_points_to_at_lft(node_ptr.as_ptr());
2151+
//@ assert [?qstatic]lifetime_token('static);
2152+
//@ open_points_to_at_lft(node_ptr.as_ptr(), qstatic);
21512153
//@ leak close_points_to_at_lft_token(_, _, _, _);
21522154
//@ assert Nodes(alloc_id, ll0.head, None, ll0.tail, None, ?nodes);
21532155
// SAFETY: node_ptr is a unique pointer to a node we boxed with self.alloc and leaked

verifast-proofs/alloc/raw_vec/mod.rs/verified/raw_vec.rs

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ lem RawVecInner_send<A>(t1: thread_id_t)
196196
close RawVecInner_own::<A>(t1, v);
197197
}
198198
199-
lem_auto RawVecInner_inv<A>()
199+
lem_auto RawVecInner_inv<A: ?Sized>()
200200
req RawVecInner::<A>(?t, ?self_, ?elemLayout, ?alloc_id, ?ptr, ?capacity);
201201
ens RawVecInner::<A>(t, self_, elemLayout, alloc_id, ptr, capacity) &*&
202202
ptr != 0 &*& ptr as usize % elemLayout.align() == 0 &*&
@@ -954,7 +954,7 @@ impl<T, A: Allocator> RawVec<T, A> {
954954
/// an allocator could overallocate and return a greater memory block than requested.
955955
pub(crate) unsafe fn into_box(self, len: usize) -> Box<[MaybeUninit<T>], A>
956956
//@ req thread_token(?t) &*& RawVec(t, self, ?alloc_id, ?ptr, len) &*& array_at_lft_(alloc_id.lft, ptr as *T, len, ?vs);
957-
//@ ens thread_token(t) &*& std::boxed::Box_slice_in::<std::mem::MaybeUninit<T>, A>(t, result, alloc_id, map(std::mem::MaybeUninit::new_maybe_uninit, vs));
957+
//@ ens thread_token(t) &*& std::boxed::Box_in::<[std::mem::MaybeUninit<T>], A>(t, result, alloc_id, slice_of_elems(map(std::mem::MaybeUninit::new_maybe_uninit, vs)));
958958
//@ on_unwind_ens thread_token(t);
959959
{
960960
// Sanity-check one half of the safety requirement (we cannot check the other half).
@@ -1005,11 +1005,12 @@ impl<T, A: Allocator> RawVec<T, A> {
10051005
//@ close_points_to(me_ref1, 1/2);
10061006
//@ end_ref_readonly(me_ref1);
10071007
//@ open_points_to(&me);
1008-
//@ std::mem::array_at_lft__to_array_at_lft_MaybeUninit(slice.ptr as *T);
1008+
//@ std::mem::array_at_lft__to_array_at_lft_MaybeUninit(slice as *T);
10091009
//@ open RawVec(_, _, _, _, _);
10101010
//@ open RawVecInner(_, _, _, _, _, _);
10111011
//@ size_align::<T>();
10121012
//@ if len * std::mem::size_of::<T>() != 0 { std::alloc::Layout_repeat_some_size_aligned(Layout::new::<T>(), len); }
1013+
//@ close_points_to_slice_at_lft(slice);
10131014
Box::from_raw_in(slice, alloc)
10141015
}
10151016
}
@@ -1090,6 +1091,7 @@ impl<T, A: Allocator> RawVec<T, A> {
10901091
// SAFETY: Precondition passed to the caller
10911092
unsafe {
10921093
let ptr = ptr.cast();
1094+
//@ std::ptr::NonNull_Sized_as_ptr(ptr);
10931095
//@ std::alloc::Layout_inv(Layout::new::<T>());
10941096
/*@
10951097
if 1 <= std::mem::size_of::<T>() && capacity != 0 {
@@ -1538,10 +1540,10 @@ impl<A: Allocator> RawVecInner<A> {
15381540
RawVecInner(t, v, elem_layout, alloc_id, ?ptr, ?capacity_) &*&
15391541
capacity <= capacity_ &*&
15401542
match init {
1541-
raw_vec::AllocInit::Uninitialized =>
1543+
AllocInit::Uninitialized =>
15421544
array_at_lft_(alloc_id.lft, ptr, ?n, _) &*&
15431545
elem_layout.size() % elem_layout.align() != 0 || n == capacity_ * elem_layout.size(),
1544-
raw_vec::AllocInit::Zeroed =>
1546+
AllocInit::Zeroed =>
15451547
array_at_lft(alloc_id.lft, ptr, ?n, ?bs) &*&
15461548
elem_layout.size() % elem_layout.align() != 0 || n == capacity_ * elem_layout.size() &*&
15471549
forall(bs, (eq)(0)) == true
@@ -1564,8 +1566,8 @@ impl<A: Allocator> RawVecInner<A> {
15641566
close RawVecInner0(r, elem_layout, ptr, capacity_);
15651567
close <RawVecInner<A>>.own(_t, r);
15661568
match init {
1567-
raw_vec::AllocInit::Uninitialized => { leak array_at_lft_(_, _, _, _); }
1568-
raw_vec::AllocInit::Zeroed => { leak array_at_lft(_, _, _, _); }
1569+
AllocInit::Uninitialized => { leak array_at_lft_(_, _, _, _); }
1570+
AllocInit::Zeroed => { leak array_at_lft(_, _, _, _); }
15691571
}
15701572
}
15711573
Result::Err(e) => { }
@@ -1604,8 +1606,8 @@ impl<A: Allocator> RawVecInner<A> {
16041606
//@ mul_zero(capacity, elem_layout.size());
16051607
/*@
16061608
match init {
1607-
raw_vec::AllocInit::Uninitialized => { close array_at_lft_(alloc_id.lft, ptr_, 0, []); }
1608-
raw_vec::AllocInit::Zeroed => { close array_at_lft(alloc_id.lft, ptr_, 0, []); }
1609+
AllocInit::Uninitialized => { close array_at_lft_(alloc_id.lft, ptr_, 0, []); }
1610+
AllocInit::Zeroed => { close array_at_lft(alloc_id.lft, ptr_, 0, []); }
16091611
}
16101612
@*/
16111613
return Ok(r);
@@ -1684,8 +1686,8 @@ impl<A: Allocator> RawVecInner<A> {
16841686
cap: unsafe { Cap::new_unchecked(capacity) },
16851687
alloc,
16861688
};
1687-
//@ std::alloc::alloc_block_in_aligned(ptr.ptr.as_ptr());
1688-
//@ close RawVecInner(t, res, elem_layout, alloc_id, ptr.ptr.as_ptr(), _);
1689+
//@ std::alloc::alloc_block_in_aligned(ptr.as_ptr() as *u8);
1690+
//@ close RawVecInner(t, res, elem_layout, alloc_id, ptr.as_ptr() as *u8, _);
16891691
Ok(res)
16901692
}
16911693

@@ -1936,7 +1938,6 @@ impl<A: Allocator> RawVecInner<A> {
19361938
<std::collections::TryReserveError>.own(t, e)
19371939
};
19381940
@*/
1939-
//@ safety_proof { assume(false); } // This function should be marked `unsafe`; see https://github.com/rust-lang/rust/pull/145067
19401941
{
19411942
//@ let k = begin_lifetime();
19421943
//@ share_RawVecInner(k, self);
@@ -2019,7 +2020,6 @@ impl<A: Allocator> RawVecInner<A> {
20192020
<std::collections::TryReserveError>.own(t, e)
20202021
};
20212022
@*/
2022-
//@ safety_proof { assume(false); } // This function should be marked `unsafe`; see https://github.com/rust-lang/rust/pull/145067
20232023
{
20242024
//@ let k = begin_lifetime();
20252025
//@ share_RawVecInner(k, self);
@@ -2100,9 +2100,9 @@ impl<A: Allocator> RawVecInner<A> {
21002100
#[inline]
21012101
unsafe fn set_ptr_and_cap(&mut self, ptr: NonNull<[u8]>, cap: usize)
21022102
//@ req (*self).ptr |-> _ &*& (*self).cap |-> _ &*& cap <= isize::MAX;
2103-
//@ ens (*self).ptr |-> Unique::from_non_null::<u8>(ptr.ptr) &*& (*self).cap |-> UsizeNoHighBit::new(cap);
2103+
//@ ens (*self).ptr |-> Unique::from_non_null::<u8>(ptr.as_non_null_ptr()) &*& (*self).cap |-> UsizeNoHighBit::new(cap);
21042104
{
2105-
//@ std::ptr::NonNull_new_as_ptr(ptr.ptr);
2105+
//@ std::ptr::NonNull_new_as_ptr(ptr.as_non_null_ptr());
21062106
// Allocators currently return a `NonNull<[u8]>` whose length matches
21072107
// the size requested. If that ever changes, the capacity here should
21082108
// change to `ptr.len() / size_of::<T>()`.
@@ -2144,7 +2144,6 @@ impl<A: Allocator> RawVecInner<A> {
21442144
<std::collections::TryReserveError>.own(t, e)
21452145
};
21462146
@*/
2147-
//@ safety_proof { assume(false); } // This function should be marked `unsafe`; see https://github.com/rust-lang/rust/pull/145067
21482147
{
21492148
// This is ensured by the calling contexts.
21502149
if cfg!(debug_assertions) { //~allow_dead_code // FIXME: The source location associated with a dead `else` branch is the entire `if` statement :-(
@@ -2229,7 +2228,7 @@ impl<A: Allocator> RawVecInner<A> {
22292228
unsafe {
22302229
self.set_ptr_and_cap(ptr, cap);
22312230
//@ let self1 = *self;
2232-
//@ std::alloc::alloc_block_in_aligned(ptr.ptr.as_ptr());
2231+
//@ std::alloc::alloc_block_in_aligned(ptr.as_ptr() as *u8);
22332232
//@ std::num::niche_types::UsizeNoHighBit_as_inner_new(cap);
22342233
//@ mul_zero(elem_layout.size(), cap);
22352234
//@ assert 0 <= self0.cap.as_inner();
@@ -2277,7 +2276,6 @@ impl<A: Allocator> RawVecInner<A> {
22772276
<std::collections::TryReserveError>.own(t, e)
22782277
};
22792278
@*/
2280-
//@ safety_proof { assume(false); } // This function should be marked `unsafe`; see https://github.com/rust-lang/rust/pull/145067
22812279
{
22822280
if elem_layout.size() == 0 {
22832281
// Since we return a capacity of `usize::MAX` when the type size is
@@ -2348,7 +2346,7 @@ impl<A: Allocator> RawVecInner<A> {
23482346
//@ mul_mono_l(1, elem_layout.size(), cap);
23492347
self.set_ptr_and_cap(ptr, cap);
23502348
//@ let self1 = *self;
2351-
//@ std::alloc::alloc_block_in_aligned(ptr.ptr.as_ptr());
2349+
//@ std::alloc::alloc_block_in_aligned(ptr.as_ptr() as *u8);
23522350
//@ std::num::niche_types::UsizeNoHighBit_as_inner_new(cap);
23532351
//@ mul_zero(elem_layout.size(), cap);
23542352
//@ assert 0 <= self0.cap.as_inner();
@@ -2537,7 +2535,7 @@ impl<A: Allocator> RawVecInner<A> {
25372535
unsafe {
25382536
//@ std::num::niche_types::UsizeNoHighBit_inv(self01.cap);
25392537
self.set_ptr_and_cap(ptr, cap);
2540-
//@ std::alloc::alloc_block_in_aligned(ptr_1.ptr.as_ptr());
2538+
//@ std::alloc::alloc_block_in_aligned(ptr_1.as_ptr() as *u8);
25412539
//@ mul_zero(cap, elem_layout.size());
25422540
//@ std::alloc::Layout_repeat_size_aligned_intro(elem_layout, cap);
25432541
//@ close RawVecInner(t, *self, elem_layout, alloc_id, _, _);
@@ -2631,8 +2629,8 @@ req thread_token(?t) &*& t == currentThread &*&
26312629
ens thread_token(t) &*& *alloc |-> ?alloc1 &*& Allocator(t, alloc1, alloc_id) &*&
26322630
match result {
26332631
Result::Ok(ptr) =>
2634-
alloc_block_in(alloc_id, ptr.ptr.as_ptr(), new_layout) &*&
2635-
array_at_lft_(alloc_id.lft, ptr.ptr.as_ptr(), new_layout.size(), _) &*&
2632+
alloc_block_in(alloc_id, ptr.as_ptr() as *u8, new_layout) &*&
2633+
array_at_lft_(alloc_id.lft, ptr.as_ptr() as *u8, new_layout.size(), _) &*&
26362634
new_layout.size() <= isize::MAX,
26372635
Result::Err(e) =>
26382636
match current_memory {
@@ -2644,7 +2642,6 @@ ens thread_token(t) &*& *alloc |-> ?alloc1 &*& Allocator(t, alloc1, alloc_id) &*
26442642
<std::collections::TryReserveError>.own(currentThread, e)
26452643
};
26462644
@*/
2647-
//@ safety_proof { assume(false); } // This function should be marked `unsafe`; see https://github.com/rust-lang/rust/pull/145067
26482645
{
26492646
let memory = if let Some((ptr, old_layout)) = current_memory {
26502647
// debug_assert_eq!(old_layout.align(), new_layout.align());

0 commit comments

Comments
 (0)