Guest User

Untitled

a guest
Jun 21st, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. struct Foo;
  2.  
  3. fn main() {
  4. let x: Box<[Foo]> = Box::new([]);
  5. let ptr = &x as *const _ as *const usize;
  6. let addr = unsafe { *ptr };
  7. let len = unsafe { *ptr.offset(1) };
  8.  
  9. println!("{:x} {:x}", addr, len);
  10. }
Add Comment
Please, Sign In to add comment