SHARE
TWEET

Untitled

a guest Oct 23rd, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. struct Foo<'a> {
  2.     f: &'a u32,
  3. }
  4.  
  5. struct Bar<'a, 'b> {
  6.     a: &'a (),
  7.     b: &'b (),
  8. }
  9.  
  10. trait Test {
  11.     fn test(&mut self);
  12. }
  13.  
  14. // works
  15. impl Test for Foo<'static> {
  16.     fn test(&mut self) {
  17.        
  18.     }
  19. }
  20.  
  21. // doesn't work
  22. impl Drop for Foo<'static> {
  23.     fn drop(&mut self) {
  24.        
  25.     }
  26. }
  27.  
  28. // works
  29. impl<'a, 'b: 'a> Test for Bar<'a, 'b> {
  30.     fn test(&mut self) {
  31.        
  32.     }
  33. }
  34.  
  35. // doesn't work
  36. impl<'a, 'b: 'a> Drop for Bar<'a, 'b> {
  37.     fn drop(&mut self) {
  38.        
  39.     }
  40. }
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
 
Top