-
Notifications
You must be signed in to change notification settings - Fork 2
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
Unify all attributes into one; support every item; add default
#1
Conversation
@@ -0,0 +1,154 @@ | |||
//! A test for every supported item. | |||
//! This test requires the nightly toolchain to compile. |
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.
Note: This file is named the way it is so that cargo test
ignores it (so you don't need nightly installed to compile)
The code looks kind of silly but it works
I've implemented |
@wackbyte You were given the contributor rights. You can merge the pull request if you want. |
Thanks! |
@JohnScience @wackbyte hey, this pr looks quite impressive. :) when will this be published on crates.io as new ver? this crate is so useful for our usecase like this: solana-labs/solana#32822 (comment) thanks for the great work. seems the latest published version v0.1.6 works for now. but I'm planning to heavily use this crate across the codebase. |
@JohnScience would have the ability to do that for you. |
@wackbyte You have been given access on crates.io as well |
@ryoqun Restored the legacy API to avoid breakage and published the 0.2 version on crates.io. Please take a look at the note on legacy attributes. |
really thanks so much (even with polishes with bunch of v0.2.x rels); just created update pr at our side: solana-labs/solana#32838 |
Adds support for all items and the
default
qualifier, all with one attribute.Implementation notes
Behavior change
My implementation of the attribute has a slightly different behavior:
Parsing logic
In order to support
const
,fn
,static
, andtype
items in all positions, I had to implement custom item types to parse them specially.Questions
Modules
Is this true? In my testing they seemed to work fine (except for the rust-analyzer issue I noted).
Fields
I did not implement support for named fields. I have a concept in mind, though: