#![feature(min_specialization)]
pub trait Foo {
fn foo(&self);
}
impl<T> Foo for T {
default fn foo(&self) {}
}
impl Foo for Box<dyn Foo> {
fn foo(&self) {}
}
This failed to compile with
error: cannot specialize on `'static` lifetime
--> src/lib.rs:15:1
|
15 | impl Foo for Box<dyn Foo> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^
This seems weird since there isn't a visible lifetime anywhere. The error should explain that the 'static lifetime is implicit on dyn Foo and suggest adding a lifetime parameter.
I tried this code:
This failed to compile with
This seems weird since there isn't a visible lifetime anywhere. The error should explain that the
'static
lifetime is implicit ondyn Foo
and suggest adding a lifetime parameter.