Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2019
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. #[derive(Debug)]
  2. struct S(i32);
  3.  
  4. impl S {
  5. fn disp(&self) {
  6. println!("S::disp() on {:?}", self);
  7. }
  8. }
  9.  
  10. impl Drop for S {
  11. fn drop(&mut self) {
  12. println!("{:?} droped", self);
  13. }
  14. }
  15.  
  16. static GL: S = S(3);
  17.  
  18. fn main() {
  19. GL.disp();
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement