The following code is possible:
function main() {
let foo = [1, 2, 3, 4]
mut slice = foo[1..2]
slice[0] = 5
println("Foo is {} and the slice is {}", foo, slice)
}
This compiles and prints Foo is [1, 5, 3, 4] and the slice is [5]
I don't know whether this is a design choice that I can't find documentation for, but it really feels like a bug to me.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too