Guest User

Untitled

a guest
Apr 23rd, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. pub trait A where Self: 'static {
  2. fn foo<'a>(self) -> Foo<'a>;
  3. }
  4.  
  5. pub enum Foo<'a> {
  6. Bar(B<'a>),
  7. Baz(C<'a>),
  8. }
  9.  
  10. pub struct B<'a> {
  11. b: &'a str,
  12. }
  13.  
  14. pub struct C<'a> {
  15. c: &'a str,
  16. }
  17.  
  18. impl A for B<'static> {
  19. fn foo<'a>(self) -> Foo<'a> {
  20. Foo::Baz(C {
  21. c: self.b,
  22. })
  23. }
  24. }
  25.  
  26. fn main() {}
Add Comment
Please, Sign In to add comment