diff --git a/kmir/pyproject.toml b/kmir/pyproject.toml index d338eeff7..6601457ea 100644 --- a/kmir/pyproject.toml +++ b/kmir/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "kmir" -version = "0.3.162" +version = "0.3.163" description = "" requires-python = "~=3.10" dependencies = [ diff --git a/kmir/src/kmir/__init__.py b/kmir/src/kmir/__init__.py index 679240233..6fff8bfbd 100644 --- a/kmir/src/kmir/__init__.py +++ b/kmir/src/kmir/__init__.py @@ -1,3 +1,3 @@ from typing import Final -VERSION: Final = '0.3.162' +VERSION: Final = '0.3.163' diff --git a/kmir/src/kmir/kdist/mir-semantics/kmir.md b/kmir/src/kmir/kdist/mir-semantics/kmir.md index 236147175..df359c7cb 100644 --- a/kmir/src/kmir/kdist/mir-semantics/kmir.md +++ b/kmir/src/kmir/kdist/mir-semantics/kmir.md @@ -45,11 +45,12 @@ function map and the initial memory have to be set up. ```k // #init step, assuming a singleton in the K cell - rule #init(_NAME:Symbol _ALLOCS:GlobalAllocs FUNCTIONS:FunctionNames ITEMS:MonoItems TYPES:TypeMappings _MACHINE:MachineInfo) + rule #init(_NAME:Symbol ALLOCS:GlobalAllocs FUNCTIONS:FunctionNames ITEMS:MonoItems TYPES:TypeMappings _MACHINE:MachineInfo) => #execFunction(#findItem(ITEMS, FUNCNAME), FUNCTIONS) _ => #mkFunctionMap(FUNCTIONS, ITEMS) + _ => #mkMemoryMap(ALLOCS) FUNCNAME _ => #mkTypeMap(.Map, TYPES) _ => #mkAdtMap(.Map, TYPES) @@ -108,7 +109,14 @@ they are callee in a `Call` terminator within an `Item`). The function _names_ and _ids_ are not relevant for calls and therefore dropped. ```k + rule #mkMemoryMap(Globals) => #accumMemory(.Map, Globals) + + rule #accumMemory(Acc, .GlobalAllocs) => Acc + rule #accumMemory(Acc, globalAllocEntry(ID, ALLOC) REST) => #accumMemory(Acc (ID |-> ALLOC), REST) + syntax Map ::= #mkFunctionMap ( FunctionNames, MonoItems ) [ function, total ] + | #mkMemoryMap ( GlobalAllocs ) [ function, total ] + | #accumMemory ( Map, GlobalAllocs ) [ function, total ] | #accumFunctions ( Map, Map, FunctionNames ) [ function, total ] | #accumItems ( Map, MonoItems ) [ function, total ] diff --git a/kmir/src/kmir/kdist/mir-semantics/rt/configuration.md b/kmir/src/kmir/kdist/mir-semantics/rt/configuration.md index a14ba74a3..1c863f684 100644 --- a/kmir/src/kmir/kdist/mir-semantics/rt/configuration.md +++ b/kmir/src/kmir/kdist/mir-semantics/rt/configuration.md @@ -46,11 +46,11 @@ module KMIR-CONFIGURATION // remaining call stack (without top frame) .List + // heap, Address(Int) -> ( GlobalAlloc | Data? ) .Map // ============ static information ============ // function store, Ty -> MonoItemFn .Map - // heap symbol($STARTSYM:String) // static information about the base type interning in the MIR .Map diff --git a/kmir/src/kmir/kdist/mir-semantics/rt/data.md b/kmir/src/kmir/kdist/mir-semantics/rt/data.md index 55291746e..fc20a0212 100644 --- a/kmir/src/kmir/kdist/mir-semantics/rt/data.md +++ b/kmir/src/kmir/kdist/mir-semantics/rt/data.md @@ -74,10 +74,11 @@ Constant operands are simply decoded according to their type. ```k rule operandConstant(constOperand(_, _, mirConst(KIND, TY, _))) => - typedValue(#decodeConstant(KIND, {TYPEMAP[TY]}:>TypeInfo), TY, mutabilityNot) + typedValue(#decodeConstant(KIND, {TYPEMAP[TY]}:>TypeInfo, MEM), TY, mutabilityNot) ... TYPEMAP + MEM requires TY in_keys(TYPEMAP) andBool isTypeInfo(TYPEMAP[TY]) [preserves-definedness] // valid Map lookup checked @@ -232,7 +233,7 @@ In the simplest case, the reference refers to a local in the same stack frame (h ```k rule #readProjection( - typedValue(Reference(0, place(local(I:Int), PLACEPROJS:ProjectionElems), _), _, _), + typedValue(RefStack(0, place(local(I:Int), PLACEPROJS:ProjectionElems), _), _, _), projectionElemDeref PROJS:ProjectionElems ) => @@ -259,7 +260,7 @@ An important prerequisite of this rule is that when passing references to a call ```k rule #readProjection( - typedValue(Reference(FRAME, place(LOCAL:Local, PLACEPROJS), _), _, _), + typedValue(RefStack(FRAME, place(LOCAL:Local, PLACEPROJS), _), _, _), projectionElemDeref PROJS ) => @@ -290,8 +291,8 @@ An important prerequisite of this rule is that when passing references to a call | #decrementRef ( TypedLocal ) [function, total] | #adjustRef (TypedLocal, Int ) [function, total] - rule #adjustRef(typedValue(Reference(HEIGHT, PLACE, REFMUT), TY, MUT), OFFSET) - => typedValue(Reference(HEIGHT +Int OFFSET, PLACE, REFMUT), TY, MUT) + rule #adjustRef(typedValue(RefStack(HEIGHT, PLACE, REFMUT), TY, MUT), OFFSET) + => typedValue(RefStack(HEIGHT +Int OFFSET, PLACE, REFMUT), TY, MUT) rule #adjustRef(TL, _) => TL [owise] rule #incrementRef(TL) => #adjustRef(TL, 1) @@ -523,7 +524,7 @@ The solution is to use rewrite operations in a downward pass through the project rule #projectedUpdate( _DEST, - typedValue(Reference(OFFSET, place(LOCAL, PLACEPROJ), _MUT), _, _), + typedValue(RefStack(OFFSET, place(LOCAL, PLACEPROJ), _MUT), _, _), projectionElemDeref PROJS, UPDATE, _CTXTS, @@ -548,7 +549,7 @@ The solution is to use rewrite operations in a downward pass through the project rule #projectedUpdate( _DEST, - typedValue(Reference(OFFSET, place(local(I), PLACEPROJ), _MUT), _, _), + typedValue(RefStack(OFFSET, place(local(I), PLACEPROJ), _MUT), _, _), projectionElemDeref PROJS, UPDATE, _CTXTS, @@ -799,7 +800,7 @@ The `BorrowKind` indicates mutability of the value through the reference, but al ```k rule rvalueRef(_REGION, KIND, PLACE) => - typedValue(Reference(0, PLACE, #mutabilityOf(KIND)), TyUnknown, #mutabilityOf(KIND)) + typedValue(RefStack(0, PLACE, #mutabilityOf(KIND)), TyUnknown, #mutabilityOf(KIND)) ... @@ -851,19 +852,19 @@ bit width, signedness, and possibly truncating or 2s-complementing the value. The `Value` sort above operates at a higher level than the bytes representation found in the MIR syntax for constant values. The bytes have to be interpreted according to the given `TypeInfo` to produce the higher-level value. This is currently only defined for `PrimitiveType`s (primitive types in MIR). ```k - syntax Value ::= #decodeConstant ( ConstantKind, TypeInfo ) [function] + syntax Value ::= #decodeConstant ( ConstantKind, TypeInfo, Map ) [function] ////////////////////////////////////////////////////////////////////////////////////// // decoding the correct amount of bytes depending on base type size // Boolean: should be one byte with value one or zero - rule #decodeConstant(constantKindAllocated(allocation(BYTES, _, _, _)), typeInfoPrimitiveType(primTypeBool)) => BoolVal(false) + rule #decodeConstant(constantKindAllocated(allocation(BYTES, _, _, _)), typeInfoPrimitiveType(primTypeBool), _MEM) => BoolVal(false) requires 0 ==Int Bytes2Int(BYTES, LE, Unsigned) andBool lengthBytes(BYTES) ==Int 1 - rule #decodeConstant(constantKindAllocated(allocation(BYTES, _, _, _)), typeInfoPrimitiveType(primTypeBool)) => BoolVal(true) + rule #decodeConstant(constantKindAllocated(allocation(BYTES, _, _, _)), typeInfoPrimitiveType(primTypeBool), _MEM) => BoolVal(true) requires 1 ==Int Bytes2Int(BYTES, LE, Unsigned) andBool lengthBytes(BYTES) ==Int 1 // Integer: handled in separate module for numeric operations - rule #decodeConstant(constantKindAllocated(allocation(BYTES, _, _, _)), TYPEINFO) + rule #decodeConstant(constantKindAllocated(allocation(BYTES, _, _, _)), TYPEINFO, _MEM) => #decodeInteger(BYTES, #intTypeOf(TYPEINFO)) requires #isIntType(TYPEINFO) @@ -872,16 +873,23 @@ The `Value` sort above operates at a higher level than the bytes representation //////////////////////////////////////////////////////////////////////////////////////////////// // FIXME Char type - // rule #decodeConstant(constantKindAllocated(allocation(BYTES, _, _, _)), typeInfoPrimitiveType(primTypeChar)) + // rule #decodeConstant(constantKindAllocated(allocation(BYTES, _, _, _), _MEM), typeInfoPrimitiveType(primTypeChar)) // => // Str(...) ///////////////////////////////////////////////////////////////////////////////////////////////// + rule #decodeConstant(constantKindAllocated(allocation(_BYTES, provenanceMap( + provenanceMapEntry(_SIZE, allocId(ID:Int)) .ProvenanceMapEntries + ), _ALIGN, _MUT)), typeInfoRefType(_TY), MEMORY) + => + RefAlloc(ID) + requires ID in_keys(MEMORY) + [preserves-definedness] // AllocId in Memory is checked, TY in Types checked previously ///////////////////////////////////////////////////////////////////////////////////////////////// // TODO Float decoding: not supported natively in K - rule #decodeConstant(_, _) => Any [owise] + rule #decodeConstant(_, _, _) => Any [owise] ``` ## Primitive operations on numeric data diff --git a/kmir/src/kmir/kdist/mir-semantics/rt/value.md b/kmir/src/kmir/kdist/mir-semantics/rt/value.md index 937faa980..7fd6ec799 100644 --- a/kmir/src/kmir/kdist/mir-semantics/rt/value.md +++ b/kmir/src/kmir/kdist/mir-semantics/rt/value.md @@ -30,7 +30,7 @@ High-level values can be // heterogenous value list for tuples and structs (standard, tuple, or anonymous) | Float( Float, Int ) // value, bit-width for f16-f128 - | Reference( Int , Place , Mutability ) + | Reference // stack depth (initially 0), place, borrow kind | Range( List ) // homogenous values for array/slice @@ -38,6 +38,9 @@ High-level values can be // address, metadata for ref/ptr | "Any" // arbitrary value for transmute/invalid ptr lookup + + syntax Reference ::= RefStack( Int , Place , Mutability ) + | RefAlloc( Int ) ``` ## Local variables diff --git a/kmir/src/tests/integration/data/exec-smir/arithmetic/arithmetic-unchecked-runs.state b/kmir/src/tests/integration/data/exec-smir/arithmetic/arithmetic-unchecked-runs.state index 53eeafebc..2b77e91a2 100644 --- a/kmir/src/tests/integration/data/exec-smir/arithmetic/arithmetic-unchecked-runs.state +++ b/kmir/src/tests/integration/data/exec-smir/arithmetic/arithmetic-unchecked-runs.state @@ -55,7 +55,8 @@ .List - .Map + 2 |-> Memory ( allocation (... bytes: b"unsafe precondition(s) violated: u8::unchecked_add cannot overflow" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 1 ) , mutability: mutabilityNot ) ) + 3 |-> Memory ( allocation (... bytes: b"unsafe precondition(s) violated: i8::unchecked_sub cannot overflow" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 1 ) , mutability: mutabilityNot ) ) ty ( 13 ) |-> monoItemFn (... name: symbol ( "std::sys::backtrace::__rust_begin_short_backtrace::" ) , id: defId ( 2 ) , body: someBody ( body (... blocks: basicBlock (... statements: .Statements , terminator: terminator (... kind: terminatorKindCall (... func: operandConstant ( constOperand (... span: span ( 31 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindZeroSized , ty: ty ( 19 ) , id: mirConstId ( 3 ) ) ) ) , args: operandMove ( place (... local: local ( 1 ) , projection: .ProjectionElems ) ) operandConstant ( constOperand (... span: span ( 32 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindZeroSized , ty: ty ( 1 ) , id: mirConstId ( 4 ) ) ) ) .Operands , destination: place (... local: local ( 0 ) , projection: .ProjectionElems ) , target: someBasicBlockIdx ( basicBlockIdx ( 1 ) ) , unwind: unwindActionContinue ) , span: span ( 33 ) ) ) basicBlock (... statements: .Statements , terminator: terminator (... kind: terminatorKindCall (... func: operandConstant ( constOperand (... span: span ( 34 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindZeroSized , ty: ty ( 20 ) , id: mirConstId ( 5 ) ) ) ) , args: operandConstant ( constOperand (... span: span ( 32 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindZeroSized , ty: ty ( 1 ) , id: mirConstId ( 4 ) ) ) ) .Operands , destination: place (... local: local ( 2 ) , projection: .ProjectionElems ) , target: someBasicBlockIdx ( basicBlockIdx ( 2 ) ) , unwind: unwindActionUnreachable ) , span: span ( 35 ) ) ) basicBlock (... statements: .Statements , terminator: terminator (... kind: terminatorKindReturn , span: span ( 36 ) ) ) .BasicBlocks , locals: localDecl (... ty: ty ( 1 ) , span: span ( 37 ) , mut: mutabilityMut ) localDecl (... ty: ty ( 7 ) , span: span ( 38 ) , mut: mutabilityNot ) localDecl (... ty: ty ( 1 ) , span: span ( 39 ) , mut: mutabilityNot ) .LocalDecls , argCount: 1 , varDebugInfo: varDebugInfo (... name: symbol ( "f" ) , sourceInfo: sourceInfo (... span: span ( 38 ) , scope: sourceScope ( 0 ) ) , composite: noVarDebugInfoFragment , value: varDebugInfoContentsPlace ( place (... local: local ( 1 ) , projection: .ProjectionElems ) ) , argumentIndex: someInt ( 1 ) ) varDebugInfo (... name: symbol ( "result" ) , sourceInfo: sourceInfo (... span: span ( 40 ) , scope: sourceScope ( 1 ) ) , composite: noVarDebugInfoFragment , value: varDebugInfoContentsPlace ( place (... local: local ( 0 ) , projection: .ProjectionElems ) ) , argumentIndex: noInt ) varDebugInfo (... name: symbol ( "dummy" ) , sourceInfo: sourceInfo (... span: span ( 41 ) , scope: sourceScope ( 2 ) ) , composite: noVarDebugInfoFragment , value: varDebugInfoContentsConst ( constOperand (... span: span ( 32 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindZeroSized , ty: ty ( 1 ) , id: mirConstId ( 4 ) ) ) ) , argumentIndex: someInt ( 1 ) ) .VarDebugInfos , spreadArg: noLocal , span: span ( 42 ) ) ) ) diff --git a/kmir/src/tests/integration/data/exec-smir/arrays/array_indexing.state b/kmir/src/tests/integration/data/exec-smir/arrays/array_indexing.state index 00e97802c..0162c2d25 100644 --- a/kmir/src/tests/integration/data/exec-smir/arrays/array_indexing.state +++ b/kmir/src/tests/integration/data/exec-smir/arrays/array_indexing.state @@ -50,7 +50,7 @@ .List - .Map + 1 |-> Memory ( allocation (... bytes: b"assertion failed: b == c" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 1 ) , mutability: mutabilityNot ) ) ty ( 13 ) |-> monoItemFn (... name: symbol ( "std::sys::backtrace::__rust_begin_short_backtrace::" ) , id: defId ( 2 ) , body: someBody ( body (... blocks: basicBlock (... statements: .Statements , terminator: terminator (... kind: terminatorKindCall (... func: operandConstant ( constOperand (... span: span ( 31 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindZeroSized , ty: ty ( 19 ) , id: mirConstId ( 3 ) ) ) ) , args: operandMove ( place (... local: local ( 1 ) , projection: .ProjectionElems ) ) operandConstant ( constOperand (... span: span ( 32 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindZeroSized , ty: ty ( 1 ) , id: mirConstId ( 4 ) ) ) ) .Operands , destination: place (... local: local ( 0 ) , projection: .ProjectionElems ) , target: someBasicBlockIdx ( basicBlockIdx ( 1 ) ) , unwind: unwindActionContinue ) , span: span ( 33 ) ) ) basicBlock (... statements: .Statements , terminator: terminator (... kind: terminatorKindCall (... func: operandConstant ( constOperand (... span: span ( 34 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindZeroSized , ty: ty ( 20 ) , id: mirConstId ( 5 ) ) ) ) , args: operandConstant ( constOperand (... span: span ( 32 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindZeroSized , ty: ty ( 1 ) , id: mirConstId ( 4 ) ) ) ) .Operands , destination: place (... local: local ( 2 ) , projection: .ProjectionElems ) , target: someBasicBlockIdx ( basicBlockIdx ( 2 ) ) , unwind: unwindActionUnreachable ) , span: span ( 35 ) ) ) basicBlock (... statements: .Statements , terminator: terminator (... kind: terminatorKindReturn , span: span ( 36 ) ) ) .BasicBlocks , locals: localDecl (... ty: ty ( 1 ) , span: span ( 37 ) , mut: mutabilityMut ) localDecl (... ty: ty ( 7 ) , span: span ( 38 ) , mut: mutabilityNot ) localDecl (... ty: ty ( 1 ) , span: span ( 39 ) , mut: mutabilityNot ) .LocalDecls , argCount: 1 , varDebugInfo: varDebugInfo (... name: symbol ( "f" ) , sourceInfo: sourceInfo (... span: span ( 38 ) , scope: sourceScope ( 0 ) ) , composite: noVarDebugInfoFragment , value: varDebugInfoContentsPlace ( place (... local: local ( 1 ) , projection: .ProjectionElems ) ) , argumentIndex: someInt ( 1 ) ) varDebugInfo (... name: symbol ( "result" ) , sourceInfo: sourceInfo (... span: span ( 40 ) , scope: sourceScope ( 1 ) ) , composite: noVarDebugInfoFragment , value: varDebugInfoContentsPlace ( place (... local: local ( 0 ) , projection: .ProjectionElems ) ) , argumentIndex: noInt ) varDebugInfo (... name: symbol ( "dummy" ) , sourceInfo: sourceInfo (... span: span ( 41 ) , scope: sourceScope ( 2 ) ) , composite: noVarDebugInfoFragment , value: varDebugInfoContentsConst ( constOperand (... span: span ( 32 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindZeroSized , ty: ty ( 1 ) , id: mirConstId ( 4 ) ) ) ) , argumentIndex: someInt ( 1 ) ) .VarDebugInfos , spreadArg: noLocal , span: span ( 42 ) ) ) ) diff --git a/kmir/src/tests/integration/data/exec-smir/arrays/array_write.state b/kmir/src/tests/integration/data/exec-smir/arrays/array_write.state index 0f43ea603..3ce67125c 100644 --- a/kmir/src/tests/integration/data/exec-smir/arrays/array_write.state +++ b/kmir/src/tests/integration/data/exec-smir/arrays/array_write.state @@ -39,7 +39,7 @@ ListItem ( typedValue ( Integer ( 0 , 64 , false ) , ty ( 25 ) , mutabilityNot ) ) ListItem ( typedValue ( Integer ( 4 , 64 , false ) , ty ( 25 ) , mutabilityMut ) ) ListItem ( Moved ) - ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 1 ) , projection: projectionElemIndex ( local ( 6 ) ) .ProjectionElems ) , mutabilityMut ) , ty ( 31 ) , mutabilityNot ) ) + ListItem ( typedValue ( RefStack ( 0 , place (... local: local ( 1 ) , projection: projectionElemIndex ( local ( 6 ) ) .ProjectionElems ) , mutabilityMut ) , ty ( 31 ) , mutabilityNot ) ) ListItem ( typedValue ( Integer ( 1 , 64 , false ) , ty ( 25 ) , mutabilityNot ) ) ListItem ( typedValue ( Integer ( 4 , 64 , false ) , ty ( 25 ) , mutabilityMut ) ) ListItem ( Moved ) @@ -59,7 +59,7 @@ .List - .Map + 1 |-> Memory ( allocation (... bytes: b"assertion failed: a[0] == a[1]" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 1 ) , mutability: mutabilityNot ) ) ty ( 13 ) |-> monoItemFn (... name: symbol ( "std::sys::backtrace::__rust_begin_short_backtrace::" ) , id: defId ( 2 ) , body: someBody ( body (... blocks: basicBlock (... statements: .Statements , terminator: terminator (... kind: terminatorKindCall (... func: operandConstant ( constOperand (... span: span ( 31 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindZeroSized , ty: ty ( 19 ) , id: mirConstId ( 3 ) ) ) ) , args: operandMove ( place (... local: local ( 1 ) , projection: .ProjectionElems ) ) operandConstant ( constOperand (... span: span ( 32 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindZeroSized , ty: ty ( 1 ) , id: mirConstId ( 4 ) ) ) ) .Operands , destination: place (... local: local ( 0 ) , projection: .ProjectionElems ) , target: someBasicBlockIdx ( basicBlockIdx ( 1 ) ) , unwind: unwindActionContinue ) , span: span ( 33 ) ) ) basicBlock (... statements: .Statements , terminator: terminator (... kind: terminatorKindCall (... func: operandConstant ( constOperand (... span: span ( 34 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindZeroSized , ty: ty ( 20 ) , id: mirConstId ( 5 ) ) ) ) , args: operandConstant ( constOperand (... span: span ( 32 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindZeroSized , ty: ty ( 1 ) , id: mirConstId ( 4 ) ) ) ) .Operands , destination: place (... local: local ( 2 ) , projection: .ProjectionElems ) , target: someBasicBlockIdx ( basicBlockIdx ( 2 ) ) , unwind: unwindActionUnreachable ) , span: span ( 35 ) ) ) basicBlock (... statements: .Statements , terminator: terminator (... kind: terminatorKindReturn , span: span ( 36 ) ) ) .BasicBlocks , locals: localDecl (... ty: ty ( 1 ) , span: span ( 37 ) , mut: mutabilityMut ) localDecl (... ty: ty ( 7 ) , span: span ( 38 ) , mut: mutabilityNot ) localDecl (... ty: ty ( 1 ) , span: span ( 39 ) , mut: mutabilityNot ) .LocalDecls , argCount: 1 , varDebugInfo: varDebugInfo (... name: symbol ( "f" ) , sourceInfo: sourceInfo (... span: span ( 38 ) , scope: sourceScope ( 0 ) ) , composite: noVarDebugInfoFragment , value: varDebugInfoContentsPlace ( place (... local: local ( 1 ) , projection: .ProjectionElems ) ) , argumentIndex: someInt ( 1 ) ) varDebugInfo (... name: symbol ( "result" ) , sourceInfo: sourceInfo (... span: span ( 40 ) , scope: sourceScope ( 1 ) ) , composite: noVarDebugInfoFragment , value: varDebugInfoContentsPlace ( place (... local: local ( 0 ) , projection: .ProjectionElems ) ) , argumentIndex: noInt ) varDebugInfo (... name: symbol ( "dummy" ) , sourceInfo: sourceInfo (... span: span ( 41 ) , scope: sourceScope ( 2 ) ) , composite: noVarDebugInfoFragment , value: varDebugInfoContentsConst ( constOperand (... span: span ( 32 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindZeroSized , ty: ty ( 1 ) , id: mirConstId ( 4 ) ) ) ) , argumentIndex: someInt ( 1 ) ) .VarDebugInfos , spreadArg: noLocal , span: span ( 42 ) ) ) ) diff --git a/kmir/src/tests/integration/data/exec-smir/references/doubleRef.state b/kmir/src/tests/integration/data/exec-smir/references/doubleRef.state index a1b59c1a6..6525a9527 100644 --- a/kmir/src/tests/integration/data/exec-smir/references/doubleRef.state +++ b/kmir/src/tests/integration/data/exec-smir/references/doubleRef.state @@ -32,25 +32,26 @@ ListItem ( newLocal ( ty ( 1 ) , mutabilityMut ) ) ListItem ( typedValue ( Integer ( 42 , 8 , true ) , ty ( 2 ) , mutabilityNot ) ) - ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 1 ) , projection: .ProjectionElems ) , mutabilityNot ) , ty ( 22 ) , mutabilityNot ) ) - ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 2 ) , projection: .ProjectionElems ) , mutabilityNot ) , ty ( 25 ) , mutabilityNot ) ) + ListItem ( typedValue ( RefStack ( 0 , place (... local: local ( 1 ) , projection: .ProjectionElems ) , mutabilityNot ) , ty ( 22 ) , mutabilityNot ) ) + ListItem ( typedValue ( RefStack ( 0 , place (... local: local ( 2 ) , projection: .ProjectionElems ) , mutabilityNot ) , ty ( 25 ) , mutabilityNot ) ) ListItem ( Moved ) ListItem ( Moved ) ListItem ( newLocal ( ty ( 34 ) , mutabilityMut ) ) ListItem ( Moved ) ListItem ( Moved ) ListItem ( Moved ) - ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 11 ) , projection: .ProjectionElems ) , mutabilityNot ) , ty ( 25 ) , mutabilityNot ) ) - ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 1 ) , projection: .ProjectionElems ) , mutabilityNot ) , ty ( 22 ) , mutabilityNot ) ) + ListItem ( typedValue ( RefStack ( 0 , place (... local: local ( 11 ) , projection: .ProjectionElems ) , mutabilityNot ) , ty ( 25 ) , mutabilityNot ) ) + ListItem ( typedValue ( RefStack ( 0 , place (... local: local ( 1 ) , projection: .ProjectionElems ) , mutabilityNot ) , ty ( 22 ) , mutabilityNot ) ) ListItem ( newLocal ( ty ( 34 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 1 ) , projection: .ProjectionElems ) , mutabilityNot ) , ty ( 22 ) , mutabilityMut ) ) + ListItem ( typedValue ( RefStack ( 0 , place (... local: local ( 1 ) , projection: .ProjectionElems ) , mutabilityNot ) , ty ( 22 ) , mutabilityMut ) ) .List - .Map + 2 |-> Memory ( allocation (... bytes: b"assertion failed: **z == x" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 1 ) , mutability: mutabilityNot ) ) + 3 |-> Memory ( allocation (... bytes: b"assertion failed: z == &&x" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 1 ) , mutability: mutabilityNot ) ) ty ( 13 ) |-> monoItemFn (... name: symbol ( "std::sys::backtrace::__rust_begin_short_backtrace::" ) , id: defId ( 2 ) , body: someBody ( body (... blocks: basicBlock (... statements: .Statements , terminator: terminator (... kind: terminatorKindCall (... func: operandConstant ( constOperand (... span: span ( 31 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindZeroSized , ty: ty ( 19 ) , id: mirConstId ( 3 ) ) ) ) , args: operandMove ( place (... local: local ( 1 ) , projection: .ProjectionElems ) ) operandConstant ( constOperand (... span: span ( 32 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindZeroSized , ty: ty ( 1 ) , id: mirConstId ( 4 ) ) ) ) .Operands , destination: place (... local: local ( 0 ) , projection: .ProjectionElems ) , target: someBasicBlockIdx ( basicBlockIdx ( 1 ) ) , unwind: unwindActionContinue ) , span: span ( 33 ) ) ) basicBlock (... statements: .Statements , terminator: terminator (... kind: terminatorKindCall (... func: operandConstant ( constOperand (... span: span ( 34 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindZeroSized , ty: ty ( 20 ) , id: mirConstId ( 5 ) ) ) ) , args: operandConstant ( constOperand (... span: span ( 32 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindZeroSized , ty: ty ( 1 ) , id: mirConstId ( 4 ) ) ) ) .Operands , destination: place (... local: local ( 2 ) , projection: .ProjectionElems ) , target: someBasicBlockIdx ( basicBlockIdx ( 2 ) ) , unwind: unwindActionUnreachable ) , span: span ( 35 ) ) ) basicBlock (... statements: .Statements , terminator: terminator (... kind: terminatorKindReturn , span: span ( 36 ) ) ) .BasicBlocks , locals: localDecl (... ty: ty ( 1 ) , span: span ( 37 ) , mut: mutabilityMut ) localDecl (... ty: ty ( 7 ) , span: span ( 38 ) , mut: mutabilityNot ) localDecl (... ty: ty ( 1 ) , span: span ( 39 ) , mut: mutabilityNot ) .LocalDecls , argCount: 1 , varDebugInfo: varDebugInfo (... name: symbol ( "f" ) , sourceInfo: sourceInfo (... span: span ( 38 ) , scope: sourceScope ( 0 ) ) , composite: noVarDebugInfoFragment , value: varDebugInfoContentsPlace ( place (... local: local ( 1 ) , projection: .ProjectionElems ) ) , argumentIndex: someInt ( 1 ) ) varDebugInfo (... name: symbol ( "result" ) , sourceInfo: sourceInfo (... span: span ( 40 ) , scope: sourceScope ( 1 ) ) , composite: noVarDebugInfoFragment , value: varDebugInfoContentsPlace ( place (... local: local ( 0 ) , projection: .ProjectionElems ) ) , argumentIndex: noInt ) varDebugInfo (... name: symbol ( "dummy" ) , sourceInfo: sourceInfo (... span: span ( 41 ) , scope: sourceScope ( 2 ) ) , composite: noVarDebugInfoFragment , value: varDebugInfoContentsConst ( constOperand (... span: span ( 32 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindZeroSized , ty: ty ( 1 ) , id: mirConstId ( 4 ) ) ) ) , argumentIndex: someInt ( 1 ) ) .VarDebugInfos , spreadArg: noLocal , span: span ( 42 ) ) ) ) diff --git a/kmir/src/tests/integration/data/exec-smir/references/mutableRef.state b/kmir/src/tests/integration/data/exec-smir/references/mutableRef.state index 4e94dcbac..3f4ead477 100644 --- a/kmir/src/tests/integration/data/exec-smir/references/mutableRef.state +++ b/kmir/src/tests/integration/data/exec-smir/references/mutableRef.state @@ -33,10 +33,10 @@ ListItem ( newLocal ( ty ( 1 ) , mutabilityMut ) ) ListItem ( typedValue ( Integer ( 22 , 8 , true ) , ty ( 2 ) , mutabilityMut ) ) ListItem ( newLocal ( ty ( 1 ) , mutabilityNot ) ) - ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 1 ) , projection: .ProjectionElems ) , mutabilityMut ) , ty ( 28 ) , mutabilityMut ) ) + ListItem ( typedValue ( RefStack ( 0 , place (... local: local ( 1 ) , projection: .ProjectionElems ) , mutabilityMut ) , ty ( 28 ) , mutabilityMut ) ) ListItem ( Moved ) ListItem ( newLocal ( ty ( 29 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 1 ) , projection: .ProjectionElems ) , mutabilityMut ) , ty ( 28 ) , mutabilityNot ) ) + ListItem ( typedValue ( RefStack ( 0 , place (... local: local ( 1 ) , projection: .ProjectionElems ) , mutabilityMut ) , ty ( 28 ) , mutabilityNot ) ) ListItem ( Moved ) ListItem ( newLocal ( ty ( 29 ) , mutabilityMut ) ) @@ -45,7 +45,8 @@ .List - .Map + 2 |-> Memory ( allocation (... bytes: b"assertion failed: x == 32" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 1 ) , mutability: mutabilityNot ) ) + 3 |-> Memory ( allocation (... bytes: b"assertion failed: x == 22" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 1 ) , mutability: mutabilityNot ) ) ty ( 13 ) |-> monoItemFn (... name: symbol ( "std::sys::backtrace::__rust_begin_short_backtrace::" ) , id: defId ( 2 ) , body: someBody ( body (... blocks: basicBlock (... statements: .Statements , terminator: terminator (... kind: terminatorKindCall (... func: operandConstant ( constOperand (... span: span ( 31 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindZeroSized , ty: ty ( 19 ) , id: mirConstId ( 3 ) ) ) ) , args: operandMove ( place (... local: local ( 1 ) , projection: .ProjectionElems ) ) operandConstant ( constOperand (... span: span ( 32 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindZeroSized , ty: ty ( 1 ) , id: mirConstId ( 4 ) ) ) ) .Operands , destination: place (... local: local ( 0 ) , projection: .ProjectionElems ) , target: someBasicBlockIdx ( basicBlockIdx ( 1 ) ) , unwind: unwindActionContinue ) , span: span ( 33 ) ) ) basicBlock (... statements: .Statements , terminator: terminator (... kind: terminatorKindCall (... func: operandConstant ( constOperand (... span: span ( 34 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindZeroSized , ty: ty ( 20 ) , id: mirConstId ( 5 ) ) ) ) , args: operandConstant ( constOperand (... span: span ( 32 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindZeroSized , ty: ty ( 1 ) , id: mirConstId ( 4 ) ) ) ) .Operands , destination: place (... local: local ( 2 ) , projection: .ProjectionElems ) , target: someBasicBlockIdx ( basicBlockIdx ( 2 ) ) , unwind: unwindActionUnreachable ) , span: span ( 35 ) ) ) basicBlock (... statements: .Statements , terminator: terminator (... kind: terminatorKindReturn , span: span ( 36 ) ) ) .BasicBlocks , locals: localDecl (... ty: ty ( 1 ) , span: span ( 37 ) , mut: mutabilityMut ) localDecl (... ty: ty ( 7 ) , span: span ( 38 ) , mut: mutabilityNot ) localDecl (... ty: ty ( 1 ) , span: span ( 39 ) , mut: mutabilityNot ) .LocalDecls , argCount: 1 , varDebugInfo: varDebugInfo (... name: symbol ( "f" ) , sourceInfo: sourceInfo (... span: span ( 38 ) , scope: sourceScope ( 0 ) ) , composite: noVarDebugInfoFragment , value: varDebugInfoContentsPlace ( place (... local: local ( 1 ) , projection: .ProjectionElems ) ) , argumentIndex: someInt ( 1 ) ) varDebugInfo (... name: symbol ( "result" ) , sourceInfo: sourceInfo (... span: span ( 40 ) , scope: sourceScope ( 1 ) ) , composite: noVarDebugInfoFragment , value: varDebugInfoContentsPlace ( place (... local: local ( 0 ) , projection: .ProjectionElems ) ) , argumentIndex: noInt ) varDebugInfo (... name: symbol ( "dummy" ) , sourceInfo: sourceInfo (... span: span ( 41 ) , scope: sourceScope ( 2 ) ) , composite: noVarDebugInfoFragment , value: varDebugInfoContentsConst ( constOperand (... span: span ( 32 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindZeroSized , ty: ty ( 1 ) , id: mirConstId ( 4 ) ) ) ) , argumentIndex: someInt ( 1 ) ) .VarDebugInfos , spreadArg: noLocal , span: span ( 42 ) ) ) ) diff --git a/kmir/src/tests/integration/data/exec-smir/references/refAsArg.state b/kmir/src/tests/integration/data/exec-smir/references/refAsArg.state index f7644429c..b7d70e4ff 100644 --- a/kmir/src/tests/integration/data/exec-smir/references/refAsArg.state +++ b/kmir/src/tests/integration/data/exec-smir/references/refAsArg.state @@ -31,7 +31,7 @@ ListItem ( newLocal ( ty ( 1 ) , mutabilityMut ) ) ListItem ( typedValue ( Integer ( 42 , 8 , true ) , ty ( 2 ) , mutabilityNot ) ) ListItem ( typedValue ( Integer ( 42 , 8 , true ) , ty ( 2 ) , mutabilityNot ) ) - ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 1 ) , projection: .ProjectionElems ) , mutabilityNot ) , ty ( 28 ) , mutabilityNot ) ) + ListItem ( typedValue ( RefStack ( 0 , place (... local: local ( 1 ) , projection: .ProjectionElems ) , mutabilityNot ) , ty ( 28 ) , mutabilityNot ) ) ListItem ( Moved ) ListItem ( newLocal ( ty ( 30 ) , mutabilityMut ) ) @@ -40,7 +40,7 @@ .List - .Map + 1 |-> Memory ( allocation (... bytes: b"assertion failed: z == x" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 1 ) , mutability: mutabilityNot ) ) ty ( 13 ) |-> monoItemFn (... name: symbol ( "std::sys::backtrace::__rust_begin_short_backtrace::" ) , id: defId ( 2 ) , body: someBody ( body (... blocks: basicBlock (... statements: .Statements , terminator: terminator (... kind: terminatorKindCall (... func: operandConstant ( constOperand (... span: span ( 31 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindZeroSized , ty: ty ( 19 ) , id: mirConstId ( 3 ) ) ) ) , args: operandMove ( place (... local: local ( 1 ) , projection: .ProjectionElems ) ) operandConstant ( constOperand (... span: span ( 32 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindZeroSized , ty: ty ( 1 ) , id: mirConstId ( 4 ) ) ) ) .Operands , destination: place (... local: local ( 0 ) , projection: .ProjectionElems ) , target: someBasicBlockIdx ( basicBlockIdx ( 1 ) ) , unwind: unwindActionContinue ) , span: span ( 33 ) ) ) basicBlock (... statements: .Statements , terminator: terminator (... kind: terminatorKindCall (... func: operandConstant ( constOperand (... span: span ( 34 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindZeroSized , ty: ty ( 20 ) , id: mirConstId ( 5 ) ) ) ) , args: operandConstant ( constOperand (... span: span ( 32 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindZeroSized , ty: ty ( 1 ) , id: mirConstId ( 4 ) ) ) ) .Operands , destination: place (... local: local ( 2 ) , projection: .ProjectionElems ) , target: someBasicBlockIdx ( basicBlockIdx ( 2 ) ) , unwind: unwindActionUnreachable ) , span: span ( 35 ) ) ) basicBlock (... statements: .Statements , terminator: terminator (... kind: terminatorKindReturn , span: span ( 36 ) ) ) .BasicBlocks , locals: localDecl (... ty: ty ( 1 ) , span: span ( 37 ) , mut: mutabilityMut ) localDecl (... ty: ty ( 7 ) , span: span ( 38 ) , mut: mutabilityNot ) localDecl (... ty: ty ( 1 ) , span: span ( 39 ) , mut: mutabilityNot ) .LocalDecls , argCount: 1 , varDebugInfo: varDebugInfo (... name: symbol ( "f" ) , sourceInfo: sourceInfo (... span: span ( 38 ) , scope: sourceScope ( 0 ) ) , composite: noVarDebugInfoFragment , value: varDebugInfoContentsPlace ( place (... local: local ( 1 ) , projection: .ProjectionElems ) ) , argumentIndex: someInt ( 1 ) ) varDebugInfo (... name: symbol ( "result" ) , sourceInfo: sourceInfo (... span: span ( 40 ) , scope: sourceScope ( 1 ) ) , composite: noVarDebugInfoFragment , value: varDebugInfoContentsPlace ( place (... local: local ( 0 ) , projection: .ProjectionElems ) ) , argumentIndex: noInt ) varDebugInfo (... name: symbol ( "dummy" ) , sourceInfo: sourceInfo (... span: span ( 41 ) , scope: sourceScope ( 2 ) ) , composite: noVarDebugInfoFragment , value: varDebugInfoContentsConst ( constOperand (... span: span ( 32 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindZeroSized , ty: ty ( 1 ) , id: mirConstId ( 4 ) ) ) ) , argumentIndex: someInt ( 1 ) ) .VarDebugInfos , spreadArg: noLocal , span: span ( 42 ) ) ) ) diff --git a/kmir/src/tests/integration/data/exec-smir/references/refAsArg2.state b/kmir/src/tests/integration/data/exec-smir/references/refAsArg2.state index 794203331..c97fc9834 100644 --- a/kmir/src/tests/integration/data/exec-smir/references/refAsArg2.state +++ b/kmir/src/tests/integration/data/exec-smir/references/refAsArg2.state @@ -31,7 +31,7 @@ ListItem ( newLocal ( ty ( 1 ) , mutabilityMut ) ) ListItem ( typedValue ( Integer ( 42 , 8 , true ) , ty ( 2 ) , mutabilityNot ) ) ListItem ( typedValue ( Integer ( 42 , 8 , true ) , ty ( 2 ) , mutabilityNot ) ) - ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 1 ) , projection: .ProjectionElems ) , mutabilityNot ) , ty ( 28 ) , mutabilityNot ) ) + ListItem ( typedValue ( RefStack ( 0 , place (... local: local ( 1 ) , projection: .ProjectionElems ) , mutabilityNot ) , ty ( 28 ) , mutabilityNot ) ) ListItem ( Moved ) ListItem ( newLocal ( ty ( 30 ) , mutabilityMut ) ) @@ -40,7 +40,7 @@ .List - .Map + 1 |-> Memory ( allocation (... bytes: b"assertion failed: z == x" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 1 ) , mutability: mutabilityNot ) ) ty ( 13 ) |-> monoItemFn (... name: symbol ( "std::sys::backtrace::__rust_begin_short_backtrace::" ) , id: defId ( 2 ) , body: someBody ( body (... blocks: basicBlock (... statements: .Statements , terminator: terminator (... kind: terminatorKindCall (... func: operandConstant ( constOperand (... span: span ( 31 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindZeroSized , ty: ty ( 19 ) , id: mirConstId ( 3 ) ) ) ) , args: operandMove ( place (... local: local ( 1 ) , projection: .ProjectionElems ) ) operandConstant ( constOperand (... span: span ( 32 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindZeroSized , ty: ty ( 1 ) , id: mirConstId ( 4 ) ) ) ) .Operands , destination: place (... local: local ( 0 ) , projection: .ProjectionElems ) , target: someBasicBlockIdx ( basicBlockIdx ( 1 ) ) , unwind: unwindActionContinue ) , span: span ( 33 ) ) ) basicBlock (... statements: .Statements , terminator: terminator (... kind: terminatorKindCall (... func: operandConstant ( constOperand (... span: span ( 34 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindZeroSized , ty: ty ( 20 ) , id: mirConstId ( 5 ) ) ) ) , args: operandConstant ( constOperand (... span: span ( 32 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindZeroSized , ty: ty ( 1 ) , id: mirConstId ( 4 ) ) ) ) .Operands , destination: place (... local: local ( 2 ) , projection: .ProjectionElems ) , target: someBasicBlockIdx ( basicBlockIdx ( 2 ) ) , unwind: unwindActionUnreachable ) , span: span ( 35 ) ) ) basicBlock (... statements: .Statements , terminator: terminator (... kind: terminatorKindReturn , span: span ( 36 ) ) ) .BasicBlocks , locals: localDecl (... ty: ty ( 1 ) , span: span ( 37 ) , mut: mutabilityMut ) localDecl (... ty: ty ( 7 ) , span: span ( 38 ) , mut: mutabilityNot ) localDecl (... ty: ty ( 1 ) , span: span ( 39 ) , mut: mutabilityNot ) .LocalDecls , argCount: 1 , varDebugInfo: varDebugInfo (... name: symbol ( "f" ) , sourceInfo: sourceInfo (... span: span ( 38 ) , scope: sourceScope ( 0 ) ) , composite: noVarDebugInfoFragment , value: varDebugInfoContentsPlace ( place (... local: local ( 1 ) , projection: .ProjectionElems ) ) , argumentIndex: someInt ( 1 ) ) varDebugInfo (... name: symbol ( "result" ) , sourceInfo: sourceInfo (... span: span ( 40 ) , scope: sourceScope ( 1 ) ) , composite: noVarDebugInfoFragment , value: varDebugInfoContentsPlace ( place (... local: local ( 0 ) , projection: .ProjectionElems ) ) , argumentIndex: noInt ) varDebugInfo (... name: symbol ( "dummy" ) , sourceInfo: sourceInfo (... span: span ( 41 ) , scope: sourceScope ( 2 ) ) , composite: noVarDebugInfoFragment , value: varDebugInfoContentsConst ( constOperand (... span: span ( 32 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindZeroSized , ty: ty ( 1 ) , id: mirConstId ( 4 ) ) ) ) , argumentIndex: someInt ( 1 ) ) .VarDebugInfos , spreadArg: noLocal , span: span ( 42 ) ) ) ) diff --git a/kmir/src/tests/integration/data/exec-smir/references/refReturned.state b/kmir/src/tests/integration/data/exec-smir/references/refReturned.state index 51a91f2bc..1b38ddc4a 100644 --- a/kmir/src/tests/integration/data/exec-smir/references/refReturned.state +++ b/kmir/src/tests/integration/data/exec-smir/references/refReturned.state @@ -30,8 +30,8 @@ ListItem ( newLocal ( ty ( 1 ) , mutabilityMut ) ) ListItem ( typedValue ( Integer ( 42 , 8 , true ) , ty ( 2 ) , mutabilityNot ) ) - ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 1 ) , projection: .ProjectionElems ) , mutabilityNot ) , ty ( 28 ) , mutabilityNot ) ) - ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 1 ) , projection: .ProjectionElems ) , mutabilityNot ) , ty ( 28 ) , mutabilityNot ) ) + ListItem ( typedValue ( RefStack ( 0 , place (... local: local ( 1 ) , projection: .ProjectionElems ) , mutabilityNot ) , ty ( 28 ) , mutabilityNot ) ) + ListItem ( typedValue ( RefStack ( 0 , place (... local: local ( 1 ) , projection: .ProjectionElems ) , mutabilityNot ) , ty ( 28 ) , mutabilityNot ) ) ListItem ( typedValue ( Integer ( 42 , 8 , true ) , ty ( 2 ) , mutabilityNot ) ) ListItem ( Moved ) ListItem ( newLocal ( ty ( 30 ) , mutabilityMut ) ) @@ -41,7 +41,7 @@ .List - .Map + 1 |-> Memory ( allocation (... bytes: b"assertion failed: z == x" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 1 ) , mutability: mutabilityNot ) ) ty ( 13 ) |-> monoItemFn (... name: symbol ( "std::sys::backtrace::__rust_begin_short_backtrace::" ) , id: defId ( 2 ) , body: someBody ( body (... blocks: basicBlock (... statements: .Statements , terminator: terminator (... kind: terminatorKindCall (... func: operandConstant ( constOperand (... span: span ( 31 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindZeroSized , ty: ty ( 19 ) , id: mirConstId ( 3 ) ) ) ) , args: operandMove ( place (... local: local ( 1 ) , projection: .ProjectionElems ) ) operandConstant ( constOperand (... span: span ( 32 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindZeroSized , ty: ty ( 1 ) , id: mirConstId ( 4 ) ) ) ) .Operands , destination: place (... local: local ( 0 ) , projection: .ProjectionElems ) , target: someBasicBlockIdx ( basicBlockIdx ( 1 ) ) , unwind: unwindActionContinue ) , span: span ( 33 ) ) ) basicBlock (... statements: .Statements , terminator: terminator (... kind: terminatorKindCall (... func: operandConstant ( constOperand (... span: span ( 34 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindZeroSized , ty: ty ( 20 ) , id: mirConstId ( 5 ) ) ) ) , args: operandConstant ( constOperand (... span: span ( 32 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindZeroSized , ty: ty ( 1 ) , id: mirConstId ( 4 ) ) ) ) .Operands , destination: place (... local: local ( 2 ) , projection: .ProjectionElems ) , target: someBasicBlockIdx ( basicBlockIdx ( 2 ) ) , unwind: unwindActionUnreachable ) , span: span ( 35 ) ) ) basicBlock (... statements: .Statements , terminator: terminator (... kind: terminatorKindReturn , span: span ( 36 ) ) ) .BasicBlocks , locals: localDecl (... ty: ty ( 1 ) , span: span ( 37 ) , mut: mutabilityMut ) localDecl (... ty: ty ( 7 ) , span: span ( 38 ) , mut: mutabilityNot ) localDecl (... ty: ty ( 1 ) , span: span ( 39 ) , mut: mutabilityNot ) .LocalDecls , argCount: 1 , varDebugInfo: varDebugInfo (... name: symbol ( "f" ) , sourceInfo: sourceInfo (... span: span ( 38 ) , scope: sourceScope ( 0 ) ) , composite: noVarDebugInfoFragment , value: varDebugInfoContentsPlace ( place (... local: local ( 1 ) , projection: .ProjectionElems ) ) , argumentIndex: someInt ( 1 ) ) varDebugInfo (... name: symbol ( "result" ) , sourceInfo: sourceInfo (... span: span ( 40 ) , scope: sourceScope ( 1 ) ) , composite: noVarDebugInfoFragment , value: varDebugInfoContentsPlace ( place (... local: local ( 0 ) , projection: .ProjectionElems ) ) , argumentIndex: noInt ) varDebugInfo (... name: symbol ( "dummy" ) , sourceInfo: sourceInfo (... span: span ( 41 ) , scope: sourceScope ( 2 ) ) , composite: noVarDebugInfoFragment , value: varDebugInfoContentsConst ( constOperand (... span: span ( 32 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindZeroSized , ty: ty ( 1 ) , id: mirConstId ( 4 ) ) ) ) , argumentIndex: someInt ( 1 ) ) .VarDebugInfos , spreadArg: noLocal , span: span ( 42 ) ) ) ) diff --git a/kmir/src/tests/integration/data/exec-smir/references/simple.state b/kmir/src/tests/integration/data/exec-smir/references/simple.state index 87f5b17ef..9f62ed9cb 100644 --- a/kmir/src/tests/integration/data/exec-smir/references/simple.state +++ b/kmir/src/tests/integration/data/exec-smir/references/simple.state @@ -29,7 +29,7 @@ ListItem ( newLocal ( ty ( 1 ) , mutabilityMut ) ) ListItem ( typedValue ( Integer ( 42 , 8 , true ) , ty ( 2 ) , mutabilityNot ) ) - ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 1 ) , projection: .ProjectionElems ) , mutabilityNot ) , ty ( 27 ) , mutabilityNot ) ) + ListItem ( typedValue ( RefStack ( 0 , place (... local: local ( 1 ) , projection: .ProjectionElems ) , mutabilityNot ) , ty ( 27 ) , mutabilityNot ) ) ListItem ( typedValue ( Integer ( 42 , 8 , true ) , ty ( 2 ) , mutabilityNot ) ) ListItem ( Moved ) ListItem ( newLocal ( ty ( 29 ) , mutabilityMut ) ) @@ -39,7 +39,7 @@ .List - .Map + 1 |-> Memory ( allocation (... bytes: b"assertion failed: z == x" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 1 ) , mutability: mutabilityNot ) ) ty ( 13 ) |-> monoItemFn (... name: symbol ( "std::sys::backtrace::__rust_begin_short_backtrace::" ) , id: defId ( 2 ) , body: someBody ( body (... blocks: basicBlock (... statements: .Statements , terminator: terminator (... kind: terminatorKindCall (... func: operandConstant ( constOperand (... span: span ( 31 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindZeroSized , ty: ty ( 19 ) , id: mirConstId ( 3 ) ) ) ) , args: operandMove ( place (... local: local ( 1 ) , projection: .ProjectionElems ) ) operandConstant ( constOperand (... span: span ( 32 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindZeroSized , ty: ty ( 1 ) , id: mirConstId ( 4 ) ) ) ) .Operands , destination: place (... local: local ( 0 ) , projection: .ProjectionElems ) , target: someBasicBlockIdx ( basicBlockIdx ( 1 ) ) , unwind: unwindActionContinue ) , span: span ( 33 ) ) ) basicBlock (... statements: .Statements , terminator: terminator (... kind: terminatorKindCall (... func: operandConstant ( constOperand (... span: span ( 34 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindZeroSized , ty: ty ( 20 ) , id: mirConstId ( 5 ) ) ) ) , args: operandConstant ( constOperand (... span: span ( 32 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindZeroSized , ty: ty ( 1 ) , id: mirConstId ( 4 ) ) ) ) .Operands , destination: place (... local: local ( 2 ) , projection: .ProjectionElems ) , target: someBasicBlockIdx ( basicBlockIdx ( 2 ) ) , unwind: unwindActionUnreachable ) , span: span ( 35 ) ) ) basicBlock (... statements: .Statements , terminator: terminator (... kind: terminatorKindReturn , span: span ( 36 ) ) ) .BasicBlocks , locals: localDecl (... ty: ty ( 1 ) , span: span ( 37 ) , mut: mutabilityMut ) localDecl (... ty: ty ( 7 ) , span: span ( 38 ) , mut: mutabilityNot ) localDecl (... ty: ty ( 1 ) , span: span ( 39 ) , mut: mutabilityNot ) .LocalDecls , argCount: 1 , varDebugInfo: varDebugInfo (... name: symbol ( "f" ) , sourceInfo: sourceInfo (... span: span ( 38 ) , scope: sourceScope ( 0 ) ) , composite: noVarDebugInfoFragment , value: varDebugInfoContentsPlace ( place (... local: local ( 1 ) , projection: .ProjectionElems ) ) , argumentIndex: someInt ( 1 ) ) varDebugInfo (... name: symbol ( "result" ) , sourceInfo: sourceInfo (... span: span ( 40 ) , scope: sourceScope ( 1 ) ) , composite: noVarDebugInfoFragment , value: varDebugInfoContentsPlace ( place (... local: local ( 0 ) , projection: .ProjectionElems ) ) , argumentIndex: noInt ) varDebugInfo (... name: symbol ( "dummy" ) , sourceInfo: sourceInfo (... span: span ( 41 ) , scope: sourceScope ( 2 ) ) , composite: noVarDebugInfoFragment , value: varDebugInfoContentsConst ( constOperand (... span: span ( 32 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindZeroSized , ty: ty ( 1 ) , id: mirConstId ( 4 ) ) ) ) , argumentIndex: someInt ( 1 ) ) .VarDebugInfos , spreadArg: noLocal , span: span ( 42 ) ) ) ) diff --git a/kmir/src/tests/integration/data/exec-smir/references/weirdRefs.state b/kmir/src/tests/integration/data/exec-smir/references/weirdRefs.state index 76b6b45ca..c9b5aea89 100644 --- a/kmir/src/tests/integration/data/exec-smir/references/weirdRefs.state +++ b/kmir/src/tests/integration/data/exec-smir/references/weirdRefs.state @@ -39,36 +39,40 @@ ListItem ( typedValue ( Aggregate ( variantIdx ( 0 ) , ListItem ( typedValue ( Integer ( 43 , 8 , true ) , ty ( 2 ) , mutabilityNot ) ) ListItem ( typedValue ( BoolVal ( true ) , ty ( 25 ) , mutabilityNot ) ) ListItem ( typedValue ( Integer ( 43 , 64 , false ) , ty ( 26 ) , mutabilityMut ) ) ) , ty ( 30 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 1 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 2 ) ) .ProjectionElems ) , mutabilityMut ) , ty ( 31 ) , mutabilityNot ) ) + ListItem ( typedValue ( RefStack ( 0 , place (... local: local ( 1 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 2 ) ) .ProjectionElems ) , mutabilityMut ) , ty ( 31 ) , mutabilityNot ) ) ListItem ( Moved ) ListItem ( newLocal ( ty ( 32 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 1 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 2 ) ) .ProjectionElems ) , mutabilityMut ) , ty ( 31 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 5 ) , projection: .ProjectionElems ) , mutabilityMut ) , ty ( 33 ) , mutabilityNot ) ) + ListItem ( typedValue ( RefStack ( 0 , place (... local: local ( 1 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 2 ) ) .ProjectionElems ) , mutabilityMut ) , ty ( 31 ) , mutabilityMut ) ) + ListItem ( typedValue ( RefStack ( 0 , place (... local: local ( 5 ) , projection: .ProjectionElems ) , mutabilityMut ) , ty ( 33 ) , mutabilityNot ) ) ListItem ( Moved ) ListItem ( newLocal ( ty ( 32 ) , mutabilityMut ) ) - ListItem ( typedValue ( Aggregate ( variantIdx ( 0 ) , ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 1 ) , projection: .ProjectionElems ) , mutabilityMut ) , ty ( 29 ) , mutabilityMut ) ) ) , ty ( 34 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 1 ) , projection: .ProjectionElems ) , mutabilityMut ) , ty ( 29 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 9 ) , projection: .ProjectionElems ) , mutabilityMut ) , ty ( 35 ) , mutabilityNot ) ) + ListItem ( typedValue ( Aggregate ( variantIdx ( 0 ) , ListItem ( typedValue ( RefStack ( 0 , place (... local: local ( 1 ) , projection: .ProjectionElems ) , mutabilityMut ) , ty ( 29 ) , mutabilityMut ) ) ) , ty ( 34 ) , mutabilityMut ) ) + ListItem ( typedValue ( RefStack ( 0 , place (... local: local ( 1 ) , projection: .ProjectionElems ) , mutabilityMut ) , ty ( 29 ) , mutabilityMut ) ) + ListItem ( typedValue ( RefStack ( 0 , place (... local: local ( 9 ) , projection: .ProjectionElems ) , mutabilityMut ) , ty ( 35 ) , mutabilityNot ) ) ListItem ( typedValue ( Integer ( 43 , 8 , true ) , ty ( 2 ) , mutabilityNot ) ) ListItem ( newLocal ( ty ( 32 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 23 ) , projection: projectionElemDeref projectionElemField ( fieldIdx ( 2 ) , ty ( 26 ) ) .ProjectionElems ) , mutabilityMut ) , ty ( 36 ) , mutabilityNot ) ) + ListItem ( typedValue ( RefStack ( 0 , place (... local: local ( 23 ) , projection: projectionElemDeref projectionElemField ( fieldIdx ( 2 ) , ty ( 26 ) ) .ProjectionElems ) , mutabilityMut ) , ty ( 36 ) , mutabilityNot ) ) ListItem ( Moved ) ListItem ( Moved ) ListItem ( newLocal ( ty ( 32 ) , mutabilityMut ) ) ListItem ( Moved ) ListItem ( newLocal ( ty ( 32 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 1 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 2 ) ) .ProjectionElems ) , mutabilityMut ) , ty ( 31 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 1 ) , projection: .ProjectionElems ) , mutabilityMut ) , ty ( 29 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 1 ) , projection: .ProjectionElems ) , mutabilityMut ) , ty ( 29 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 1 ) , projection: .ProjectionElems ) , mutabilityMut ) , ty ( 29 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 1 ) , projection: .ProjectionElems ) , mutabilityMut ) , ty ( 29 ) , mutabilityMut ) ) + ListItem ( typedValue ( RefStack ( 0 , place (... local: local ( 1 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 2 ) ) .ProjectionElems ) , mutabilityMut ) , ty ( 31 ) , mutabilityMut ) ) + ListItem ( typedValue ( RefStack ( 0 , place (... local: local ( 1 ) , projection: .ProjectionElems ) , mutabilityMut ) , ty ( 29 ) , mutabilityMut ) ) + ListItem ( typedValue ( RefStack ( 0 , place (... local: local ( 1 ) , projection: .ProjectionElems ) , mutabilityMut ) , ty ( 29 ) , mutabilityMut ) ) + ListItem ( typedValue ( RefStack ( 0 , place (... local: local ( 1 ) , projection: .ProjectionElems ) , mutabilityMut ) , ty ( 29 ) , mutabilityMut ) ) + ListItem ( typedValue ( RefStack ( 0 , place (... local: local ( 1 ) , projection: .ProjectionElems ) , mutabilityMut ) , ty ( 29 ) , mutabilityMut ) ) .List - .Map + 5 |-> Memory ( allocation (... bytes: b"assertion failed: a.a_value == 42" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 1 ) , mutability: mutabilityNot ) ) + 6 |-> Memory ( allocation (... bytes: b"assertion failed: a.a_value == 43" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 1 ) , mutability: mutabilityNot ) ) + 7 |-> Memory ( allocation (... bytes: b"assertion failed: vv == 43" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 1 ) , mutability: mutabilityNot ) ) + 8 |-> Memory ( allocation (... bytes: b"assertion failed: a.another" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 1 ) , mutability: mutabilityNot ) ) + 9 |-> Memory ( allocation (... bytes: b"assertion failed: a.a_third == 43" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 1 ) , mutability: mutabilityNot ) ) ty ( 13 ) |-> monoItemFn (... name: symbol ( "std::sys::backtrace::__rust_begin_short_backtrace::" ) , id: defId ( 2 ) , body: someBody ( body (... blocks: basicBlock (... statements: .Statements , terminator: terminator (... kind: terminatorKindCall (... func: operandConstant ( constOperand (... span: span ( 31 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindZeroSized , ty: ty ( 19 ) , id: mirConstId ( 3 ) ) ) ) , args: operandMove ( place (... local: local ( 1 ) , projection: .ProjectionElems ) ) operandConstant ( constOperand (... span: span ( 32 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindZeroSized , ty: ty ( 1 ) , id: mirConstId ( 4 ) ) ) ) .Operands , destination: place (... local: local ( 0 ) , projection: .ProjectionElems ) , target: someBasicBlockIdx ( basicBlockIdx ( 1 ) ) , unwind: unwindActionContinue ) , span: span ( 33 ) ) ) basicBlock (... statements: .Statements , terminator: terminator (... kind: terminatorKindCall (... func: operandConstant ( constOperand (... span: span ( 34 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindZeroSized , ty: ty ( 20 ) , id: mirConstId ( 5 ) ) ) ) , args: operandConstant ( constOperand (... span: span ( 32 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindZeroSized , ty: ty ( 1 ) , id: mirConstId ( 4 ) ) ) ) .Operands , destination: place (... local: local ( 2 ) , projection: .ProjectionElems ) , target: someBasicBlockIdx ( basicBlockIdx ( 2 ) ) , unwind: unwindActionUnreachable ) , span: span ( 35 ) ) ) basicBlock (... statements: .Statements , terminator: terminator (... kind: terminatorKindReturn , span: span ( 36 ) ) ) .BasicBlocks , locals: localDecl (... ty: ty ( 1 ) , span: span ( 37 ) , mut: mutabilityMut ) localDecl (... ty: ty ( 7 ) , span: span ( 38 ) , mut: mutabilityNot ) localDecl (... ty: ty ( 1 ) , span: span ( 39 ) , mut: mutabilityNot ) .LocalDecls , argCount: 1 , varDebugInfo: varDebugInfo (... name: symbol ( "f" ) , sourceInfo: sourceInfo (... span: span ( 38 ) , scope: sourceScope ( 0 ) ) , composite: noVarDebugInfoFragment , value: varDebugInfoContentsPlace ( place (... local: local ( 1 ) , projection: .ProjectionElems ) ) , argumentIndex: someInt ( 1 ) ) varDebugInfo (... name: symbol ( "result" ) , sourceInfo: sourceInfo (... span: span ( 40 ) , scope: sourceScope ( 1 ) ) , composite: noVarDebugInfoFragment , value: varDebugInfoContentsPlace ( place (... local: local ( 0 ) , projection: .ProjectionElems ) ) , argumentIndex: noInt ) varDebugInfo (... name: symbol ( "dummy" ) , sourceInfo: sourceInfo (... span: span ( 41 ) , scope: sourceScope ( 2 ) ) , composite: noVarDebugInfoFragment , value: varDebugInfoContentsConst ( constOperand (... span: span ( 32 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindZeroSized , ty: ty ( 1 ) , id: mirConstId ( 4 ) ) ) ) , argumentIndex: someInt ( 1 ) ) .VarDebugInfos , spreadArg: noLocal , span: span ( 42 ) ) ) ) diff --git a/kmir/src/tests/integration/data/prove-rs/ptr-metadata-array-fail.rs b/kmir/src/tests/integration/data/prove-rs/ptr-metadata-array-fail.rs new file mode 100644 index 000000000..a06ffc2d8 --- /dev/null +++ b/kmir/src/tests/integration/data/prove-rs/ptr-metadata-array-fail.rs @@ -0,0 +1,6 @@ +fn main() { + let len = [1; 2].len(); + let len2 = [4; 3].len(); + assert!(len == 2); + assert!(len2 == 3); +} \ No newline at end of file diff --git a/kmir/src/tests/integration/data/prove-rs/ptr-metadata-slice-fail.rs b/kmir/src/tests/integration/data/prove-rs/ptr-metadata-slice-fail.rs new file mode 100644 index 000000000..4e441f695 --- /dev/null +++ b/kmir/src/tests/integration/data/prove-rs/ptr-metadata-slice-fail.rs @@ -0,0 +1,4 @@ +fn main() { + let t = [1; 2]; + assert!(&t[..] == t); +} \ No newline at end of file diff --git a/kmir/src/tests/integration/data/prove-rs/show/assert_eq_exp-fail.expected b/kmir/src/tests/integration/data/prove-rs/show/assert_eq_exp-fail.expected index 7ecce8811..e54da3382 100644 --- a/kmir/src/tests/integration/data/prove-rs/show/assert_eq_exp-fail.expected +++ b/kmir/src/tests/integration/data/prove-rs/show/assert_eq_exp-fail.expected @@ -6,7 +6,7 @@ │ │ (88 steps) └─ 3 (stuck, leaf) - #readProjection ( typedValue ( Any , ty ( 25 ) , mutabilityNot ) , projectionEle + #readProjection ( typedValue ( RefAlloc ( 0 ) , ty ( 25 ) , mutabilityNot ) , pr function: main span: 101 diff --git a/kmir/src/tests/integration/data/prove-rs/show/bitwise-not-shift-fail.expected b/kmir/src/tests/integration/data/prove-rs/show/bitwise-not-shift-fail.expected index 6086a86ae..63265c2bf 100644 --- a/kmir/src/tests/integration/data/prove-rs/show/bitwise-not-shift-fail.expected +++ b/kmir/src/tests/integration/data/prove-rs/show/bitwise-not-shift-fail.expected @@ -6,7 +6,7 @@ │ │ (254 steps) └─ 3 (stuck, leaf) - #readProjection ( typedValue ( Any , ty ( 25 ) , mutabilityNot ) , projectionEle + #readProjection ( typedValue ( RefAlloc ( 8 ) , ty ( 25 ) , mutabilityNot ) , pr span: 63 diff --git a/kmir/src/tests/integration/data/prove-rs/show/ptr-metadata-array-fail.expected b/kmir/src/tests/integration/data/prove-rs/show/ptr-metadata-array-fail.expected new file mode 100644 index 000000000..f9d5bf1fb --- /dev/null +++ b/kmir/src/tests/integration/data/prove-rs/show/ptr-metadata-array-fail.expected @@ -0,0 +1,17 @@ + +┌─ 1 (root, init) +│ #init ( symbol ( "ptr_metadata_array_fail" ) globalAllocEntry ( 0 , Memory ( all +│ function: main +│ span: 51 +│ +│ (27 steps) +└─ 3 (stuck, leaf) + #applyUnOp ( unOpPtrMetadata , typedValue ( thunk ( #cast ( typedValue ( RefAllo + function: main + span: 53 + + +┌─ 2 (root, leaf, target, terminal) +│ #EndProgram + + diff --git a/kmir/src/tests/integration/data/prove-rs/show/ptr-metadata-slice-fail.expected b/kmir/src/tests/integration/data/prove-rs/show/ptr-metadata-slice-fail.expected new file mode 100644 index 000000000..40e235a6c --- /dev/null +++ b/kmir/src/tests/integration/data/prove-rs/show/ptr-metadata-slice-fail.expected @@ -0,0 +1,16 @@ + +┌─ 1 (root, init) +│ #init ( symbol ( "ptr_metadata_slice_fail" ) globalAllocEntry ( 1 , Memory ( all +│ function: main +│ span: 127 +│ +│ (156 steps) +└─ 3 (stuck, leaf) + #applyUnOp ( unOpPtrMetadata , typedValue ( thunk ( #cast ( typedValue ( RefStac + span: 58 + + +┌─ 2 (root, leaf, target, terminal) +│ #EndProgram + + diff --git a/kmir/src/tests/integration/test_integration.py b/kmir/src/tests/integration/test_integration.py index 89b8cab6d..abc2b75cd 100644 --- a/kmir/src/tests/integration/test_integration.py +++ b/kmir/src/tests/integration/test_integration.py @@ -435,6 +435,8 @@ def test_prove(spec: Path, tmp_path: Path, kmir: KMIR) -> None: 'interior-mut3-fail', 'assert_eq_exp-fail', 'bitwise-not-shift-fail', + 'ptr-metadata-array-fail', + 'ptr-metadata-slice-fail', ] diff --git a/kmir/uv.lock b/kmir/uv.lock index 16c6ad2dc..df2fb5022 100644 --- a/kmir/uv.lock +++ b/kmir/uv.lock @@ -491,7 +491,7 @@ wheels = [ [[package]] name = "kmir" -version = "0.3.162" +version = "0.3.163" source = { editable = "." } dependencies = [ { name = "kframework" }, diff --git a/package/version b/package/version index e41771856..ee7ed8106 100644 --- a/package/version +++ b/package/version @@ -1 +1 @@ -0.3.162 +0.3.163