From bf883726d771988c838bc6a6e1c012dfb008769c Mon Sep 17 00:00:00 2001 From: Son Ho Date: Tue, 11 Jun 2024 13:59:39 +0200 Subject: Update the tests for tuples --- tests/src/no_nested_borrows.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'tests/src') diff --git a/tests/src/no_nested_borrows.rs b/tests/src/no_nested_borrows.rs index 11c4a695..20f8efea 100644 --- a/tests/src/no_nested_borrows.rs +++ b/tests/src/no_nested_borrows.rs @@ -479,7 +479,19 @@ pub fn read_then_incr(x: &mut u32) -> u32 { pub struct Tuple(T1, T2); -pub fn use_tuple_struct(x: &mut Tuple) { +pub fn read_tuple(x: &(u32, u32)) -> u32 { + x.0 +} + +pub fn update_tuple(x: &mut (u32, u32)) { + x.0 = 1; +} + +pub fn read_tuple_struct(x: &Tuple) -> u32 { + x.0 +} + +pub fn update_tuple_struct(x: &mut Tuple) { x.0 = 1; } -- cgit v1.2.3