-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clarify error on ambiguous associated type ("Try using Iterator
" instead of "X as Trait")
#46585
Comments
Iterator
" instead of "X as Trait
")Iterator
" instead of "X as Trait")
Iterator
" instead of "X as Trait")Iterator
" instead of "X as Trait")
Thought: if |
The idea is that both
and
crawl the list of traits that The error is reported in rust/src/librustc_resolve/lib.rs Line 2547 in e0d11f3
Since this error is reported during name resolution, I don't think it is possible to figure out all the traits that the type implements. Instead we can crawl the AST to find all |
Hey, I am going to try fix this. |
Current output:
@oli-obk's idea to crawl the traits implemented for |
Any updates on this? I recently stumbled upon this issue when I was trying to implement some trait for mockall. |
…rrors When suggesting writing a fully qualified path probe for appropriate types Address the more common part of rust-lang#46585.
…rrors When suggesting writing a fully qualified path probe for appropriate types Address the more common part of rust-lang#46585.
Hi, I think this error message is unclear.
https://play.rust-lang.org/?gist=5b08c55cf63a625ced0cbaf83b4db0de&version=stable
The solution is here:
https://play.rust-lang.org/?gist=3ce26cc2d8cbd16533b884a1f8f76900&version=stable
@oli-obk suggested mentoring a PR to add a suggestion for possible trait types in the
impl
. This Issue serves as a starting point.The text was updated successfully, but these errors were encountered: