/
githubmirror
/
sway
Обзор
Документация
Войти
/
githubmirror
/
sway
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
test/src/ir_generation/tests/mutable_struct.sw
27 строк
585 B
Vaivaswatha N
Represent `RawUntypedPtr` AST type using a new `Pointer` IR type (#7272)
22 июл 2025, 07:26
Не верифицирован
22 июл 2025, 07:26
a5e6148
Код
Авторство
О чём код?
script; fn main() -> u64 { let mut record = Record { a: 40, b: 2, }; record.a = 50; record.b } struct Record { a: u64, b: u64, } // check: local mut { u64, u64 } record // The first get_local when initialising record: // check: get_local __ptr { u64, u64 }, record // The second one when mutating. // check: $(rec_var=$VAL) = get_local __ptr { u64, u64 }, record // check: $(idx_0=$VAL) = const u64 0 // check: $(a_ptr=$VAL) = get_elem_ptr $rec_var, __ptr u64, $idx_0 // check: $(fifty=$VAL) = const u64 50 // check: store $fifty to $a_ptr