Open
Description
Hi! I'm just learning Rust! I saw this odd behavior, where the compiler will nicely tell me that an index in an array is impossible at compile time, but won't tell me that an index in a slice of known size is also impossible.
I thought I'd share.
This fails at compile time:
let y = [1];
println!("y={}", y[1]);
This fails at runtime:
let y = [1];
println!("y={}", &y[0..1][1]);
Would be cool if &y[0..1][1]
also failed at compile time.