Closed
Description
fn main() {
let a = "haha";
println!("Nope. {}", a[1..-1]);
}
Compilation succeeds without any warning.
-1 is silently converted to an unsigned int, and I get an executable that panics with index 1 and/or 18446744073709551615 in
hahado not lie on character boundary
I think there should be a compilation warning or error.
Metadata
Metadata
Assignees
Labels
No labels