v2 / vlib / v / checker / tests / slice_clone_notice.out
15 lines · 15 sloc · 601 bytes · e2e5cf8db56f3562c7baa735061690be936bdf3e
Raw
1vlib/v/checker/tests/slice_clone_notice.vv:4:13: notice: an implicit clone of the slice was done here
2 2 | xs := [1, 2, 3, 4, 5, 6, 7, 8]
3 3 |
4 4 | mut s := xs[1..]
5 | ~~~~~
6 5 |
7 6 | s.sort(a > b)
8Details: vlib/v/checker/tests/slice_clone_notice.vv:4:13: details: To silence this notice, use either an explicit `a[..].clone()`,
9or use an explicit `unsafe{ a[..] }`, if you do not want a copy of the slice.
10 2 | xs := [1, 2, 3, 4, 5, 6, 7, 8]
11 3 |
12 4 | mut s := xs[1..]
13 | ~~~~~
14 5 |
15 6 | s.sort(a > b)
16