You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Default methods interact surprisingly with Auto-dereference
The first version (method provided by trait impl) auto-dereferences and works.
trait A { fn a(&self); }
impl A for int { fn a(&self) {} };
let s = &1i; s.a()
Moving the method implementation to a default method, does not resolve any more:
trait A { fn a(&self) { } }
impl A for int { } ;
let s = &1i; s.a()
<anon>:22:0: 22:6 error: type `&<VI0>` does not implement any method in scope named `a`
Default methods interact surprisingly with Auto-dereference
The first version (method provided by trait impl) auto-dereferences and works.
Moving the method implementation to a default method, does not resolve any more:
cc @msullivan
Relevant to issue #6246
First discovered this issue with Newtypes. But it also applies to simple &T auto-deref! Edited to simplify the testcase.
The text was updated successfully, but these errors were encountered: