Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. struct F;
  2.  
  3. impl F {
  4. fn foo(&self) -> *const Self {
  5. self as *const _
  6. }
  7. }
  8.  
  9. impl Drop for F {
  10. fn drop(&mut self) {
  11. println!("destroy");
  12. }
  13. }
  14.  
  15. fn bar(s: *const F) {
  16. println!("call");
  17. }
  18.  
  19. fn main() {
  20. bar(F.foo());
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement