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
Go to definition doesn't work for trait implementations for structs inside function bodies #14782
Comments
In general, IDE features like these interacting with impls should be aware of block impls for the cursor position. |
Why cursor position? I noticed this when trying to mir interpret some function in standard library which used this pattern, I guess cursor position wouldn't work for it. Isn't is possible to consider the block impls of the |
We cannot consider all block implementations, for that we would need to look into all bodies which goes against the lazy analysis strategy we employ in r-a. |
(Note cursor position in this case would be identifier we are invoking this go to on, so take cursor position as "relevant context position for the current task") |
Oh I see, sorry. I assumed the go to def fuctionality was faulty. But this is the infernece results not recording properly. Point still stands, for resolving the |
This case is allowed in rust-lang/rfcs#3373 so we should support it, but I think it is possible to do it without breaking laziness.
I guess we do it in method resolution, but not in the |
Indeed, it looks like |
In this example r-a sees method, and can infer that the type of
t
isi32
, but go to definition onfoo
will go to the trait function, not the impl one.The text was updated successfully, but these errors were encountered: