-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
internal: Handle trait alias definitions #14184
Conversation
baacee6
to
aa2140e
Compare
Looks good to me 🎉 |
Update: I began adding test, which quickly made me realize that I forgot to impl
I've implemented taking the second approach as it seemed simpler, but I'm happy to hear opinions and thoughts. EDIT: I've experimented with the first approach and I found it somewhat cumbersome to deal with |
This is now ready for full review. The commits are starting to get cluttered, I can squash relevant commits after review if desired. Fully working IDE functionalities:
Partially working IDE functionalities (generally working for trait alias itself, but needs type support for full functionalities):
non-applicable functionalities: all others |
☔ The latest upstream changes (presumably #14223) made this pull request unmergeable. Please resolve the merge conflicts. |
1e46aa5
to
361f431
Compare
Since we moved impl trait handling to other place, there are only two cases now: those that introduce implicit `Self` parameter and those that don't.
361f431
to
f8eac19
Compare
Rebased and organized commits. There's no diff in the final tree modulo now resolved conflict (which was merely one import statement). This PR should be good to go! |
@bors r+ |
☀️ Test successful - checks-actions |
Might be worth noting explicitly in the changelog that we haven't implemented trait alias in our type system. FYI, I was going to implement type support for trait alias, but after seeing rust-lang/rust#107614, I'm putting it on hold until types/lang teams decide what to do with it. |
@lowr Do you know what is the current state of trait aliases? Did the dust settle? |
@HKalbasi I'm not really sure about its current state. The PR I mentioned in my last comment has been merged but without any decisions involved (which is reasonable as it's an unstable feature after all). |
Part of #2773
This PR adds a bunch of structs and enum variants for trait aliases. Trait aliases should be handled as an independent item because they are semantically distinct from traits.
I basically started by adding
TraitAlias{Id, Loc}
tohir_def::item_tree
and iterated adding necessary stuffs until compiler stopped complaining what's missing. Let me know if there's still anything I need to add.I'm opening up this PR for early review and stuff. I'm planning to add tests for IDE functionalities in this PR, but not type-related support, for which I put FIXME notes.