2015-02-12 09:29:52 -06:00
|
|
|
trait Foo {
|
|
|
|
fn dummy(&self) { }
|
|
|
|
}
|
2014-06-23 12:42:13 -05:00
|
|
|
|
|
|
|
struct A;
|
|
|
|
|
|
|
|
impl Foo for A {}
|
|
|
|
|
2019-05-28 13:46:13 -05:00
|
|
|
struct B<'a>(&'a (dyn Foo + 'a));
|
2014-06-23 12:42:13 -05:00
|
|
|
|
2019-05-28 13:46:13 -05:00
|
|
|
fn foo<'a>(a: &dyn Foo) -> B<'a> {
|
2018-12-25 09:56:47 -06:00
|
|
|
B(a) //~ ERROR explicit lifetime required in the type of `a` [E0621]
|
2014-06-23 12:42:13 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let _test = foo(&A);
|
|
|
|
}
|