-
Notifications
You must be signed in to change notification settings - Fork 278
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
[refactor]: introduce syn 2.0, manyhow and darling for proc-macros #3727
Merged
appetrosyan
merged 6 commits into
hyperledger-iroha:iroha2-dev
from
DCNick3:syn2-manyhow-showcase
Jul 28, 2023
Merged
[refactor]: introduce syn 2.0, manyhow and darling for proc-macros #3727
appetrosyan
merged 6 commits into
hyperledger-iroha:iroha2-dev
from
DCNick3:syn2-manyhow-showcase
Jul 28, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
github-actions
bot
added
the
iroha2-dev
The re-implementation of a BFT hyperledger in RUST
label
Jul 20, 2023
DCNick3
changed the title
[refactor] introduce syn 2.0 + manyhow showcase
[refactor]: introduce syn 2.0 + manyhow showcase
Jul 20, 2023
DCNick3
force-pushed
the
syn2-manyhow-showcase
branch
from
July 20, 2023 11:47
a659db3
to
cb2d401
Compare
Pull Request Test Coverage Report for Build 5689584713
💛 - Coveralls |
DCNick3
changed the title
[refactor]: introduce syn 2.0 + manyhow showcase
[refactor]: introduce syn 2.0 + manyhow and darling showcase
Jul 20, 2023
DCNick3
force-pushed
the
syn2-manyhow-showcase
branch
from
July 20, 2023 13:26
5398793
to
fa53dad
Compare
appetrosyan
reviewed
Jul 21, 2023
version/derive/tests/ui_fail/unknown_field_in_version_attribute.stderr
Outdated
Show resolved
Hide resolved
DCNick3
force-pushed
the
syn2-manyhow-showcase
branch
from
July 21, 2023 10:59
fa53dad
to
b912308
Compare
DCNick3
changed the title
[refactor]: introduce syn 2.0 + manyhow and darling showcase
[refactor]: introduce syn 2.0, manyhow and darling for proc-macros
Jul 21, 2023
DCNick3
requested review from
s8sato,
mversic,
Arjentix,
SamHSmith,
QuentinI,
outoftardis,
ilchu,
pesterev,
Erigara and
0x009922
as code owners
July 21, 2023 13:05
appetrosyan
force-pushed
the
syn2-manyhow-showcase
branch
from
July 24, 2023 07:57
fadaae2
to
f0c5e00
Compare
appetrosyan
previously approved these changes
Jul 24, 2023
DCNick3
force-pushed
the
syn2-manyhow-showcase
branch
2 times, most recently
from
July 26, 2023 13:31
05a71e5
to
5ead4f2
Compare
appetrosyan
previously approved these changes
Jul 26, 2023
DCNick3
force-pushed
the
syn2-manyhow-showcase
branch
from
July 26, 2023 15:14
5ead4f2
to
0ed222a
Compare
appetrosyan
previously approved these changes
Jul 26, 2023
appetrosyan
force-pushed
the
syn2-manyhow-showcase
branch
from
July 27, 2023 07:48
0ed222a
to
d2907e7
Compare
Erigara
previously approved these changes
Jul 28, 2023
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.
Good job!
DCNick3
force-pushed
the
syn2-manyhow-showcase
branch
from
July 28, 2023 07:13
d2907e7
to
5055e57
Compare
appetrosyan
approved these changes
Jul 28, 2023
Erigara
approved these changes
Jul 28, 2023
…proc-macro-error with manyhow Signed-off-by: Nikita Strygin <DCNick3@users.noreply.github.com>
Also update names of parameters of `#[version]` attribute Signed-off-by: Nikita Strygin <DCNick3@users.noreply.github.com>
Signed-off-by: Nikita Strygin <DCNick3@users.noreply.github.com>
Signed-off-by: Nikita Strygin <DCNick3@users.noreply.github.com>
It's just strum::EnumCount anyways Signed-off-by: Nikita Strygin <DCNick3@users.noreply.github.com>
- use darling's traits to parse the input - cover attributes with tests - add a diagnostic for a common error: attribute on variant instead of field - ensure spans for generated enums are linked to enum variants, which improves "conflicting implementation" errors Signed-off-by: Nikita Strygin <DCNick3@users.noreply.github.com>
appetrosyan
force-pushed
the
syn2-manyhow-showcase
branch
from
July 28, 2023 07:52
5055e57
to
3dcce7b
Compare
3 tasks
This was referenced Sep 21, 2023
Closed
This was referenced Sep 28, 2023
Migrate
iroha_smart_contract_derive
, iroha_executor_derive
and iroha_trigger_derive
to syn 2.0
#3934
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR adds
syn
2.0 to the workspace (under the name ofsyn2
, to allow co-existence of different versions).It then updates
iroha_version_derive
,iroha_primitives_derive
andiroha_derive
to use syn2, as well as moving from unmaintainedproc-macro-error
tomanyhow
.It also changes some macro APIs:
I also propose the following changes for
VariantCount
macro (not yet implemented):VariantCount
are placed on fields instead of enum variants. I suggest we move them to variants, as it's really a property of the variant#[skip_try_from]
is confusing in the context of #[skip_from]: the different in names is in the try, but they correspond to different directions of the generated conversions: from is forVariant
->Enum
andtry_from
is forEnum
->Variant
. I suggest changing the name to#[skip_into]
or#[skip_try_into]
to properly represent the change of conversion direction, even if the actual generated trait isFrom
#[skip_container]
to#[skip_from_container]
?Benefits
Unlike
proc-macro-error
,manyhow
is actively maintained and has cleaner API that does not rely on global state.Using
darling
streamlines parsing of (most) attributes by using a declarative serde-like model, also providing reasonable error messages.