rust/tests/ui/issues/issue-14285.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
257 B
Rust
Raw Normal View History

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