Skip to content

Commit cf54fdd

Browse files
committed
test(integration): add iter-eq repro with red show snapshot
1 parent 64a795b commit cf54fdd

3 files changed

Lines changed: 49 additions & 0 deletions

File tree

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
fn main() {
2+
let _keep: fn() -> bool = repro;
3+
}
4+
5+
#[inline(never)]
6+
#[no_mangle]
7+
pub fn repro() -> bool {
8+
let k0 = Pubkey([1; 32]);
9+
let k1 = Pubkey([2; 32]);
10+
let k2 = Pubkey([3; 32]);
11+
let n = 2usize;
12+
13+
let accounts = [
14+
AccountInfo { key: &k0 },
15+
AccountInfo { key: &k1 },
16+
AccountInfo { key: &k2 },
17+
];
18+
let signers = [k1, k2, k0];
19+
20+
accounts[1..]
21+
.iter()
22+
.map(|signer| *signer.key)
23+
.eq(signers.iter().take(n).copied())
24+
}
25+
26+
#[derive(Clone)]
27+
struct AccountInfo<'a> {
28+
key: &'a Pubkey,
29+
}
30+
31+
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
32+
struct Pubkey([u8; 32]);
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
┌─ 1 (root, init)
3+
│ #execTerminator ( terminator ( ... kind: terminatorKindCall ( ... func: operandC
4+
│ span: 0
5+
6+
│ (1060 steps)
7+
└─ 3 (stuck, leaf)
8+
ListItem ( thunk ( operandConstant ( constOperand ( ... span: span ( 137 ) , use
9+
span: 137
10+
11+
12+
┌─ 2 (root, leaf, target, terminal)
13+
│ #EndProgram ~> .K
14+
15+

kmir/src/tests/integration/test_integration.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
'assume-cheatcode-conflict-fail': ['check_assume_conflict'],
3939
'transmute-bytes': ['bytes_to_u64', 'u64_to_bytes'],
4040
'test_offset_from-fail': ['testing'],
41+
'iter-eq-copied-take-dereftruncate-fail': ['repro'],
4142
}
4243
PROVE_RS_SHOW_SPECS = [
4344
'local-raw-fail',
@@ -57,6 +58,7 @@
5758
'transmute-u8-to-enum-changed-discriminant-signed-fail',
5859
'assert-inhabited-fail',
5960
'iterator-simple',
61+
'iter-eq-copied-take-dereftruncate-fail',
6062
'unions-fail',
6163
'transmute-maybe-uninit-fail',
6264
'ptr-through-wrapper-fail',

0 commit comments

Comments
 (0)