check inside a lambda set for whether it is reference counted

This commit is contained in:
Folkert 2023-07-26 20:06:37 +02:00
parent 73ffce0baa
commit 334253f47f
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
7 changed files with 34 additions and 31 deletions

View file

@ -1046,23 +1046,22 @@ fn refcount_list<'a>(
let modify_list = modify_refcount_stmt(Pointer::ToData(data_pointer));
let is_relevant_op = ctx.op.is_dec() || ctx.op.is_inc();
let modify_elems_and_list =
if is_relevant_op && layout_interner.get_repr(elem_layout).is_refcounted() {
refcount_list_elems(
root,
ident_ids,
ctx,
layout_interner,
elem_layout,
LAYOUT_UNIT,
ptr_layout,
len,
first_element_pointer,
modify_list,
)
} else {
modify_list
};
let modify_elems_and_list = if is_relevant_op && layout_interner.is_refcounted(elem_layout) {
refcount_list_elems(
root,
ident_ids,
ctx,
layout_interner,
elem_layout,
LAYOUT_UNIT,
ptr_layout,
len,
first_element_pointer,
modify_list,
)
} else {
modify_list
};
//
// JoinPoint for slice vs list