mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 05:49:08 +00:00
WIP
This commit is contained in:
parent
4a9514d2c4
commit
0247237fe8
16 changed files with 625 additions and 163 deletions
|
@ -741,6 +741,14 @@ impl<'a> BorrowInfState<'a> {
|
|||
self.if_is_owned_then_own(z, *x);
|
||||
}
|
||||
|
||||
UnionFieldPtrAtIndex { structure: x, .. } => {
|
||||
// if the structure (record/tag/array) is owned, the extracted value is
|
||||
self.if_is_owned_then_own(*x, z);
|
||||
|
||||
// if the extracted value is owned, the structure must be too
|
||||
self.if_is_owned_then_own(z, *x);
|
||||
}
|
||||
|
||||
GetTagId { structure: x, .. } => {
|
||||
// if the structure (record/tag/array) is owned, the extracted value is
|
||||
self.if_is_owned_then_own(*x, z);
|
||||
|
@ -1035,7 +1043,9 @@ pub fn lowlevel_borrow_signature(arena: &Bump, op: LowLevel) -> &[Ownership] {
|
|||
unreachable!("These lowlevel operations are turned into mono Expr's")
|
||||
}
|
||||
|
||||
PtrWrite => arena.alloc_slice_copy(&[irrelevant, irrelevant]),
|
||||
PtrStore => arena.alloc_slice_copy(&[owned, borrowed]),
|
||||
PtrLoad => arena.alloc_slice_copy(&[owned]),
|
||||
PtrToZeroed => arena.alloc_slice_copy(&[owned]),
|
||||
|
||||
PtrCast | RefCountIncRcPtr | RefCountDecRcPtr | RefCountIncDataPtr | RefCountDecDataPtr
|
||||
| RefCountIsUnique => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue