Advertisement
Guest User

Untitled

a guest
Jul 21st, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. #![allow(unreachable_code)]
  2.  
  3.  
  4. fn main() {
  5. println!("{:?}", {
  6. #[inline(never)]pub fn f(ary: &[u8; 5]) -> &[u8] {let idx = 1e100f64 as usize;&ary[idx..]} println!("{}", f(&[1; 5])[0xdeadbeef]);
  7. });
  8. }
  9.  
  10.  
  11. /* ~~~~=== stderr ===~~~~
  12. Compiling playground v0.0.1 (/playground)
  13. Finished dev [unoptimized + debuginfo] target(s) in 0.46s
  14. Running `target/debug/playground`
  15. thread 'main' panicked at 'slice index starts at 93950871891210 but ends at 5', src/libcore/slice/mod.rs:2561:5
  16. note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
  17.  
  18. */
  19.  
  20. /* ~~~~=== stdout ===~~~~
  21.  
  22. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement