daily pastebin goal
14%
SHARE
TWEET

Untitled

a guest Apr 23rd, 2018 41 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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() {}
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