Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions kmir/src/kmir/kdist/mir-semantics/rt/data.md
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,11 @@ A `Deref` projection in the projections list changes the target of the write ope
</k>
<stack> STACK
=> STACK[(FRAME -Int 1) <-
#updateStackLocal({STACK[FRAME -Int 1]}:>StackFrame, I, #buildUpdate(NEW, CONTEXTS))
#updateStackLocal(
{STACK[FRAME -Int 1]}:>StackFrame,
I,
#adjustRef(#buildUpdate(NEW, CONTEXTS), 0 -Int FRAME)
)
]
</stack>
requires 0 <Int FRAME andBool FRAME <=Int size(STACK)
Expand All @@ -283,7 +287,11 @@ A `Deref` projection in the projections list changes the target of the write ope
</k>
<stack> STACK
=> STACK[(FRAME -Int 1) <-
#updateStackLocal({STACK[FRAME -Int 1]}:>StackFrame, I, #buildUpdate(Moved, CONTEXTS)) // TODO retain Ty and Mutability from _ORIGINAL
#updateStackLocal(
{STACK[FRAME -Int 1]}:>StackFrame,
I,
#adjustRef(#buildUpdate(Moved, CONTEXTS), 0 -Int FRAME)
) // TODO retain Ty and Mutability from _ORIGINAL
]
</stack>
requires 0 <Int FRAME andBool FRAME <=Int size(STACK)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
┃ │
┃ │ (6 steps)
┃ ├─ 10
┃ │ #traverseProjection ( toStack ( 1 , local ( 2 ) ) , Range ( #mapOffset ( range (
┃ │ #traverseProjection ( toStack ( 1 , local ( 2 ) ) , Range ( #mapOffset ( #mapOff
┃ │ span: 87
┃ ┃
┃ ┃ (1 step)
Expand All @@ -59,7 +59,7 @@
┃ ┗━━┓
┃ │
┃ └─ 12 (stuck, leaf)
┃ #traverseProjection ( toStack ( 1 , local ( 2 ) ) , Range ( #mapOffset ( range (
┃ #traverseProjection ( toStack ( 1 , local ( 2 ) ) , Range ( #mapOffset ( #mapOff
┃ span: 87
┗━━┓
Expand Down
13 changes: 13 additions & 0 deletions kmir/src/tests/integration/data/prove-rs/stack_assign.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
fn assign<'a>(dst: &mut &'a i32, src: &&'a i32) {
*dst = *src;
}

fn main() {
let x = 1;
let mut dst = &x;
let src = dst;

assign(&mut dst, &src);

assert_eq!(*dst, 1);
}