interplane.Get Omega
Read in your language

omega-mv

Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.

Brought by drakestapleton

branch main Branches Tags History

omega-mv / tests / compiler / neg / ma_move_in_loop_while_borrowed.osc

9 lines · 277 bytes Raw Blame History
1// expect: MUTABLE_ALIAS object=a line=7
2// transition: move while borrowed
3fn consume(value: own [u8; 2]) -> u8 { return value[0]; }
4fn f() -> u8 {
5 let a: own [u8; 2] = alloc(3);
6 let r: &[u8; 2] = &a;
7 for i in 0 .. 3 { let x: u8 = consume(a); }
8 return r[0];
9}