mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 05:49:08 +00:00
remove Reuse
This commit is contained in:
parent
1daf975391
commit
f27cb83a02
11 changed files with 33 additions and 125 deletions
|
@ -234,12 +234,13 @@ fn insert_reset_reuse_operations_stmt<'a, 'i>(
|
|||
|
||||
new_triplets.into_iter().rev().fold(
|
||||
new_continuation,
|
||||
|new_continuation, (binding, (reused, new_expr), layout)| {
|
||||
|new_continuation, (binding, (opt_ptr_cast, new_expr), layout)| {
|
||||
let new_let =
|
||||
arena.alloc(Stmt::Let(*binding, new_expr, *layout, new_continuation));
|
||||
match reused {
|
||||
// The layout for the reuse does not match that of the reset, use PtrCast to convert the layout.
|
||||
Some(wrap) => wrap(new_let),
|
||||
|
||||
// if the layout for the reuse does not match that of the reset, use PtrCast to convert the layout.
|
||||
match opt_ptr_cast {
|
||||
Some(ptr_cast) => ptr_cast(new_let),
|
||||
None => new_let,
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue