Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement