mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-24 15:54:15 +00:00
18 lines
257 B
Rust
18 lines
257 B
Rust
trait Foo {
|
|
fn dummy(&self) { }
|
|
}
|
|
|
|
struct A;
|
|
|
|
impl Foo for A {}
|
|
|
|
struct B<'a>(&'a (dyn Foo + 'a));
|
|
|
|
fn foo<'a>(a: &dyn Foo) -> B<'a> {
|
|
B(a) //~ ERROR explicit lifetime required in the type of `a` [E0621]
|
|
}
|
|
|
|
fn main() {
|
|
let _test = foo(&A);
|
|
}
|