Closed
Description
Consider this code:
trait Foo
{
fn foo(self) {}
}
trait Bar
{
fn bar(self) {}
}
struct S;
impl<'l> Foo for &'l S {}
impl<T: Foo> Bar for T {}
fn main()
{
let s = S;
s.foo(); // Works fine
(&s).bar(); // Works fine
s.bar(); // Doesn't work
}
The error is:
test.rs:22:5: 22:12 error: failed to find an implementation of trait Foo for S
test.rs:22 s.bar();
It'd be nice if the explicit ref wasn't required in this case.