SHARE
TWEET

Untitled

a guest Oct 23rd, 2019 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top