Guest User

Untitled

a guest
Jun 21st, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. struct Foo;
  2.  
  3. trait Bar {
  4. fn baz(&self);
  5. }
  6.  
  7. impl Bar for Foo {
  8. fn baz(&self) {
  9. println!("hi");
  10. }
  11. }
  12.  
  13. fn main() {
  14. let x: Box<Bar> = Box::new(Foo);
  15. let y: Box<Foo> = Box::new(Foo);
  16.  
  17. println!("{:p} {:p}", x, y);
  18. }
Add Comment
Please, Sign In to add comment