You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In several procedural macro crates I need to calculate the value of numeric enumeration variants. Currently I copy over the function every time, but I can not imagine that I am the only user of the syn crate, that would benefit from an integrated variant.
I do not know how feasible it is to have this in syn, because afaik core::convert::TryInto is nightly only, as of now.
I am not too experienced with Rust yet, and not sure how correct and complete my implementation is, as the enumeration variant expressions I use are not too complicated normally, but this is somewhat in the direction I would need (does not account for float values):
Neat! Thanks for the suggestion and example implementation.
I am closing the issue because I would prefer for this to be developed outside of Syn. Syn is a parsing library and I don't think expanding into other areas of compilation beyond parsing like name resolution or const evaluation would be a good idea.
In several procedural macro crates I need to calculate the value of numeric enumeration variants. Currently I copy over the function every time, but I can not imagine that I am the only user of the
syn
crate, that would benefit from an integrated variant.I do not know how feasible it is to have this in
syn
, because afaikcore::convert::TryInto
is nightly only, as of now.I am not too experienced with Rust yet, and not sure how correct and complete my implementation is, as the enumeration variant expressions I use are not too complicated normally, but this is somewhat in the direction I would need (does not account for float values):
The text was updated successfully, but these errors were encountered: