Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pub trait A where Self: 'static {
- fn foo<'a>(self) -> Foo<'a>;
- }
- pub enum Foo<'a> {
- Bar(B<'a>),
- Baz(C<'a>),
- }
- pub struct B<'a> {
- b: &'a str,
- }
- pub struct C<'a> {
- c: &'a str,
- }
- impl A for B<'static> {
- fn foo<'a>(self) -> Foo<'a> {
- Foo::Baz(C {
- c: self.b,
- })
- }
- }
- fn main() {}
Add Comment
Please, Sign In to add comment