Trait method has higher precedence than inherent method if autoref is required for the inherent method #68826
Labels
A-trait-system
Area: Trait system
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
T-lang
Relevant to the language team, which will review and decide on the PR/issue.
I was very surprised when I found the following outputs "trait method" (playground):
Up until now I always thought that an inherent method always takes precedence over a trait method of the same name. Is that not true in this case / is this behaviour intended?
This came up in yew, which defined an inherent
try_into
(now renamed) with a type parameter that would start producing errors about unexpected type parameters whenTryInto
(orstdweb::unstable::TryInto
) was brought into scope.The text was updated successfully, but these errors were encountered: