Closed
Description
Code
trait A<'x> {}
trait B<'x> {}
struct Foo<'b> {
pub bar: &'b dyn for<'a> A<'a>,
}
impl<'a> B<'a> for dyn for<'b> A<'b> {}
impl<'a> A<'a> for Foo<'a> {}
Output
(From the Playground.)
#[prelude_import]
use std::prelude::rust_2018::*;
#[macro_use]
extern crate std;
trait A<'x> { }
trait B<'x> { }
struct Foo<'b> {
pub bar: &'b dyn for<'a> A,
}
impl <'a> B for dyn for<'b> A { }
impl <'a> A for Foo { }
Note that the uses of A
, B
, and Foo
don't include their lifetimes.