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
// (deliberately commented out to show error msg)// use m::T;mod m {pubtraitT{fnhi(&self) -> ~str;}}structS;impl m::TforS{fnhi(&self) -> ~str{ ~"HelloWorld" }}fnmain(){let s = S;println(s.hi());}
Compiler error message:
/tmp/implerr.rs:10:12: 10:19 error: type `S` does not implement any method in scope named `hi`
/tmp/implerr.rs:10 println(s.hi());
^~~~~~~
error: aborting due to previous error
We can do better here; e.g. the compiler could scan the known traits implemented for S and suggest that the user use m::T here. (I often forget to add the use, and thus keep hitting this.)
The text was updated successfully, but these errors were encountered:
Code:
Compiler error message:
We can do better here; e.g. the compiler could scan the known traits implemented for S and suggest that the user
use m::T
here. (I often forget to add theuse
, and thus keep hitting this.)The text was updated successfully, but these errors were encountered: