From 03144f978f40c01cadab9e6513a77b4a353a059d Mon Sep 17 00:00:00 2001 From: Folkert Date: Thu, 21 Oct 2021 20:28:18 +0200 Subject: [PATCH] Revert "clippy" This reverts commit 7773cf9b4d6d908345c21f9d0053e0647f65fb21. --- compiler/gen_llvm/src/llvm/refcounting.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/compiler/gen_llvm/src/llvm/refcounting.rs b/compiler/gen_llvm/src/llvm/refcounting.rs index a640119d4b..d1d0cc344e 100644 --- a/compiler/gen_llvm/src/llvm/refcounting.rs +++ b/compiler/gen_llvm/src/llvm/refcounting.rs @@ -736,8 +736,9 @@ fn modify_refcount_list_help<'a, 'ctx, 'env>( builder.position_at_end(modification_block); - let ptr_type = basic_type_from_layout(env, element_layout).ptr_type(AddressSpace::Generic); if element_layout.contains_refcounted() { + let ptr_type = basic_type_from_layout(env, element_layout).ptr_type(AddressSpace::Generic); + let (len, ptr) = load_list(env.builder, original_wrapper, ptr_type); let refcount_ptr = PointerToRefcount::from_ptr_to_data(env, ptr); @@ -789,6 +790,8 @@ fn modify_refcount_list_help<'a, 'ctx, 'env>( } } else { // just increment/decrement the list itself, don't touch the elements + let ptr_type = basic_type_from_layout(env, element_layout).ptr_type(AddressSpace::Generic); + let (_, ptr) = load_list(env.builder, original_wrapper, ptr_type); let refcount_ptr = PointerToRefcount::from_ptr_to_data(env, ptr);