remove Reuse

This commit is contained in:
Folkert 2023-06-28 22:02:02 +02:00
parent 1daf975391
commit f27cb83a02
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
11 changed files with 33 additions and 125 deletions

View file

@ -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,
}
},