rust/src/test/ui/issues/issue-14285.rs

18 lines
257 B
Rust
Raw Normal View History

trait Foo {
fn dummy(&self) { }
}
struct A;
impl Foo for A {}
2019-05-28 13:46:13 -05:00
struct B<'a>(&'a (dyn Foo + 'a));
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]
}
fn main() {
let _test = foo(&A);
}