Undefs, huh? Undefs are fun. They tend to propagate. After a few minutes of wrangling…
#[inline(never)]
pub fn f(ary: &[u8; 5]) -> &[u8] {
let idx = 1e100f64 as usize;
&ary[idx..]
}
fn main() {
println!("{}", f(&[1; 5])[0xdeadbeef]);
}
segfaults on my system (latest nightly) with -O.