Why doesn't the RUST compiler warns while accessing index which is out of bounds?

66 points SnooMacaroons3057

A little snippet -

let my_str: &str = "Hello world";

println!("{}", &my_str[0..300]);

This programs compiles just fine. Shouldn't this give us a warning or error during the compilation process instead of panic'ing during runtime? Since the size/length of the slice is known at any given time, shouldn't it be obvious?