Closed
Description
trait A {}
struct B<'a, T> { f: &'a T }
impl<'a, T> A for B<'a, T> {}
fn foo(_: &A) {}
fn bar<T>(b: &B<T>) { foo(b) }
fn main() {}
Compiles with:
foo.rs:7:27: 7:28 error: value may contain references; add `'static` bound
foo.rs:7 fn bar<T>(b: &B<T>) { foo(b) }
^
error: aborting due to previous error
If I change it to foo(b as &A)
the code compiles just fine. Perhaps a coercion bug?
Metadata
Metadata
Assignees
Labels
No labels