Guest User

Untitled

a guest
Jan 15th, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. struct Foo;
  2. trait Bar
  3. {
  4. fn bar(self);
  5. }
  6.  
  7. impl Bar for &Foo
  8. {
  9. fn bar(self)
  10. {
  11.  
  12. }
  13. }
  14.  
  15. fn test<'a> (x: &'a Foo)
  16. {
  17. //QUESTION!:
  18. // v---< is this lifetime inferred to be 'a ?
  19. <&'_ Foo>::bar(x);
  20. }
  21.  
  22. fn main() {
  23. test(&Foo);
  24. }
Add Comment
Please, Sign In to add comment