-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
Enum support for pin_project! macro #28
Conversation
e9bce38
to
6ec85af
Compare
90d81aa
to
6f37824
Compare
I'm wondering what syntax is preferable, so I would appreciate any feedback. |
What if the attribute syntax was used, similar to the one in pin-project? So perhaps something like |
Ah, that looks like a good idea. There may be a limitation like #3, but I'll try it. |
3b9ec82
to
4eadb74
Compare
I've tried the attribute syntax and it looks good overall. (Thanks @stjepang for the suggestion!) Limitations of the current implementation I know of are:
|
It's okay if there are a few limitations with known workarounds. I think it's amazing that you managed to pull this off at all without procedural macros :) |
4d58c2f
to
08fbe17
Compare
6377bdb
to
bbd40ed
Compare
I think the implementation is now basically complete, but I'll look into limitations and minor bugs before the merge. |
Filed #36 to track diagnostics issues. I'm okay with merge this. bors r+ |
Build succeeded: |
38: Release 0.2.0 r=taiki-e a=taiki-e [Changes](https://github.com/taiki-e/pin-project-lite/blob/2d8bba1905bfc2da22a16c7e40703cd02d141916/CHANGELOG.md#020---2020-11-13) #28 has made significant changes to the existing parsing and may cause some breakage, so bump minor version. Co-authored-by: Taiki Endo <te316e89@gmail.com>
Published in 0.2.0. |
Like pin-project, by passing an argument with the same name as the method to the attribute, you can name the projection type returned from the method. This allows you to use pattern matching on the projected types.
Also, this does not provide support to tuple variants for the same reason that it does not support tuple structs.