In Rust, the following code would work:
fn test_slice(slices: &[i32]) {
println!("{:?}", slices);
}
fn main() {
let slices:&[i32] = &[1,2,3];
test_slice(slices);
}
However, why the code below would also work instead of giving type mismatch error?
fn main() {
let slices:&[i32] = &[1,2,3];
test_slice(&&&slices);
}