Guest User

Untitled

a guest
Feb 16th, 2019
91
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. impl std::ops::Drop for Foo {
  4. fn drop(&mut self) {
  5. println!("drop");
  6. }
  7. }
  8. impl Foo {
  9. fn as_ptr(&self) -> i32 { 0 }
  10. }
  11.  
  12. fn bar(x: i32) {
  13. println!("bar");
  14. }
  15. fn main() {
  16. bar(Foo.as_ptr());
  17. }
Add Comment
Please, Sign In to add comment