From 1573795fab78e08afd1d33db339da12e2f8ac5b7 Mon Sep 17 00:00:00 2001 From: Maxim Vezenov Date: Wed, 4 Dec 2024 18:45:48 +0000 Subject: [PATCH] missed ref count --- .../execution_success/reference_counts/src/main.nr | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test_programs/execution_success/reference_counts/src/main.nr b/test_programs/execution_success/reference_counts/src/main.nr index 8ff9df1d91c..86b5c812472 100644 --- a/test_programs/execution_success/reference_counts/src/main.nr +++ b/test_programs/execution_success/reference_counts/src/main.nr @@ -1,6 +1,6 @@ fn main() { let mut array = [0, 1, 2]; - assert_refcount(array, 1); + assert_refcount(array, 2); borrow(array, std::mem::array_refcount(array)); borrow_mut(&mut array, std::mem::array_refcount(array)); @@ -13,13 +13,13 @@ fn borrow(array: [Field; 3], rc_before_call: u32) { } fn borrow_mut(array: &mut [Field; 3], rc_before_call: u32) { - assert_refcount(*array, rc_before_call + 1); // Issue! This should be rc_before_call + 1 + assert_refcount(*array, rc_before_call + 1); array[0] = 5; println(array[0]); } fn copy_mut(mut array: [Field; 3], rc_before_call: u32) { - assert_refcount(array, rc_before_call + 1); // Issue! This should be rc_before_call + 1 + assert_refcount(array, rc_before_call + 1); array[0] = 6; println(array[0]); }