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
Method dispatch does not search in traits that a compound trait inherits. Example below, on 0.8-pre @c5194740a78ec113cb6cbc937e7263e2548f62f6. Generics work though on compound traits.
structA;pubtraitMethod1Able{pubfnmethod1(&self);}pubtraitTest:Method1Able{}implMethod1AbleforA{pubfnmethod1(&self){()}}implTestforA{}fngeneric<T:Test>(a:&T){
a.method1();// works}fnmain(){letmut a = A;generic(&a);{letmut b = &a as&Test;
b.method1();// error: type `&Test<no-bounds>` does not// implement any method in scope named `method1`}}
The text was updated successfully, but these errors were encountered:
…s, r=flip1995
Allow primitive types in disallowed_methods
Fixesrust-lang#8079
changelog: `disallowed_methods`: Now can disallow methods of primitive types
Method dispatch does not search in traits that a compound trait inherits. Example below, on 0.8-pre @c5194740a78ec113cb6cbc937e7263e2548f62f6. Generics work though on compound traits.
The text was updated successfully, but these errors were encountered: