| 1 | fn takes_quad_ref(x &&&&int) { |
| 2 | unsafe { |
| 3 | ****x = 5 |
| 4 | } |
| 5 | } |
| 6 | |
| 7 | fn takes_triple_ref(x &&&int) { |
| 8 | unsafe { |
| 9 | ***x = 7 |
| 10 | } |
| 11 | } |
| 12 | |
| 13 | fn test_call_arg_with_multi_ref_from_value() { |
| 14 | mut y := 4 |
| 15 | takes_quad_ref(y) |
| 16 | assert y == 5 |
| 17 | } |
| 18 | |
| 19 | fn test_call_arg_with_multi_ref_from_ref() { |
| 20 | mut y := 4 |
| 21 | p := &y |
| 22 | takes_triple_ref(p) |
| 23 | assert y == 7 |
| 24 | } |
| 25 |