Skip to content

Instantly share code, notes, and snippets.

@cengiz-io
Created July 31, 2016 11:32
Show Gist options
  • Save cengiz-io/1f2890c8d96c3f8ef1d8a45c43b7198e to your computer and use it in GitHub Desktop.
Save cengiz-io/1f2890c8d96c3f8ef1d8a45c43b7198e to your computer and use it in GitHub Desktop.
#[inline(never)]
pub fn f(ary: &[u8; 5]) -> &[u8] {
let idx = 1e100f64 as usize;
&ary[idx..]
}
fn main() {
let a = &[1; 5];
let z = f(a);
println!("{}", z[0xdeadbeef]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment