Closed
Description
This code:
trait Foo {
fn do_foo(&self);
}
trait Bar {
fn do_bar(&self);
}
impl<T> Bar for T where T: Foo {
fn do_bar(&self) {
self.do_foo()
}
}
struct Obj {
obj: Box<Bar + 'static>
}
impl Obj {
fn process(&self) {
self.obj.do_bar();
}
}
Produces:
<anon>:21:9: 21:26 error: the trait `Foo` is not implemented for the type `Box<Bar>`
<anon>:21 self.obj.do_bar();
I think that this kind of code used to work in the past, so it could be a regression.
Even if this code is not supposed to work, the error message makes no sense.
Metadata
Metadata
Assignees
Labels
No labels