-
Notifications
You must be signed in to change notification settings - Fork 234
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
Add support for cfg_attr-like attributes #2113
Conversation
22dcf62
to
9388d1f
Compare
9388d1f
to
83ff3c6
Compare
IIUC, this change makes it so that if a UniFFI attribute appears inside a nested meta list then we apply it to the current item. I think this is what #2086 was doing as well. I'm not sure if it will be the final solution, but it could be a nice hack that solves 80% of the cases. I'm interested to hear what @rafaelbeckel and @jplatte think though. |
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.
The code looks correct to me, @rafaelbeckel likes it. Can we merge this one?
I'd still much prefer the main attribute be constrained to be exactly IMHO it is more important that accidentally doing the wrong thing is prevented (i.e. a user writes |
I have no strong opinion about this, and restricting it to |
9e40316
to
a74d704
Compare
a74d704
to
a5e536f
Compare
Thank you @bendk, @jplatte and @rafaelbeckel for the feedback. I've limited the new functionality to only support |
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.
Looks good to me. Limiting it to cfg_attr
solves the original issue just fine. I can't think of other use cases. If there is one, someone else will open another issue in the future.
Can we please add a section at the end of here (I guess?) and maybe even a changelog? :) |
thank you @mhammond, should have done it earlier. Please see if update to docs is making sense. Copywriting is not necessarily my strength :) |
Thanks! |
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.
Looks good to me, thanks for adding those docs.
Hello uniffi team!
I came across issue #2000 in my code and came up with what may solve this problem for a number scenarios. I do realize that this is not 100% bulletproof, but may work good enough before we figure out a better approach. Happy to add support for more scenarios. Any feedback is welcome.