-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Resolve associated types #8283
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Resolve associated types #8283
Conversation
crates/hir/src/source_analyzer.rs
Outdated
}, | ||
_ => return None, | ||
}; | ||
// FIXME supertraits |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We got a function for this in hir_ty
, I guess it would make sense to move it to hir_def
?(I think it's implementation solely relies on hir_def
). I have no clue in which module that would belong in that case though, unless a new utils
module like it is in hir_ty
https://github.com/rust-analyzer/rust-analyzer/blob/25201b2dad7b4b0d41494e238ebf643ad7ad8cd6/crates/hir_ty/src/utils.rs#L81
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I probably want to get rid of all_super_traits
, but it might be nice to turn all_super_trait_refs
into a query.
I'm not a fan of the duplication of logic. Actually Also, I'm not sure whether this handles |
It doesn't handle
|
Oh, I think I didn't even see |
LGTM, r=me |
bors r=flodiebold |
changelog fix: Resolve associated types at the IDE layer |
Prior we were only resolving paths until the first type was found, then discarding the result if the path wasn't fully consumed. That of course causes associated types to not resolve. Fixes #5003