diff options
author | Son Ho | 2024-06-11 13:59:39 +0200 |
---|---|---|
committer | Son Ho | 2024-06-11 13:59:39 +0200 |
commit | bf883726d771988c838bc6a6e1c012dfb008769c (patch) | |
tree | 5d16356c24ef82b1055f64a959eddd75ea401817 /tests/src | |
parent | 73e27b142b65ec37fbbc55a5a7d0299555b2b60b (diff) |
Update the tests for tuples
Diffstat (limited to 'tests/src')
-rw-r--r-- | tests/src/no_nested_borrows.rs | 14 |
1 files changed, 13 insertions, 1 deletions
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>(T1, T2); -pub fn use_tuple_struct(x: &mut Tuple<u32, u32>) { +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, u32>) -> u32 { + x.0 +} + +pub fn update_tuple_struct(x: &mut Tuple<u32, u32>) { x.0 = 1; } |