Skip to content

Commit

Permalink
Merge pull request #1061 from dewert99/ghostptrtoken-derefmut
Browse files Browse the repository at this point in the history
Fix spec for `GhostPtrTokenMut::deref_mut`
  • Loading branch information
dewert99 authored Aug 6, 2024
2 parents d7e2eef + 06ca9ca commit 9644f4e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions creusot-contracts/src/ghost_ptr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ impl<'a, T: ?Sized> DerefMut for GhostPtrTokenMut<'a, T> {
#[trusted]
#[ensures((*result)@ == (*self).cur())]
#[ensures((^self).cur() == (^result)@)]
#[ensures((^self).fin() == (*self).fin())]
fn deref_mut(&mut self) -> &mut Self::Target {
Box::leak(Box::new(GhostPtrToken(PhantomData)))
}
Expand Down
2 changes: 1 addition & 1 deletion creusot/tests/should_succeed/ghost_ptr_token.coma
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ module GhostPtrToken_Test

let%span span44 = "../../../../creusot-contracts/src/ghost_ptr.rs" 202 4 202 44

let%span span45 = "../../../../creusot-contracts/src/ghost_ptr.rs" 280 8 280 32
let%span span45 = "../../../../creusot-contracts/src/ghost_ptr.rs" 281 8 281 32

let%span span46 = "../../../../creusot-contracts/src/logic/fmap.rs" 13 15 13 19

Expand Down

0 comments on commit 9644f4e

Please sign in to comment.