Advertisement
Guest User

Untitled

a guest
Sep 16th, 2019
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. #![allow(unused)]
  2.  
  3. struct Foo([u8; 64]);
  4.  
  5. fn get_foo() -> (Foo, Box<Foo>) {
  6. (Foo([0; 64]), Box::new(Foo([0; 64])))
  7. }
  8.  
  9. fn get_bar() {
  10. ...
  11. let foo = get_foo();
  12. ...
  13. foo
  14. }
  15.  
  16. fn main() {
  17. let foo_vec = vec![Box::new(Foo([0; 64])); 1000];
  18. for foo in &foo_vec {
  19. foo.0[32]
  20. }
  21. let _ = get_bar();
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement