dtolnay / proc-macro-workshop

Learn to write Rust procedural macros  [Rust Latam conference, Montevideo Uruguay, March 2019]
Apache License 2.0
4k stars 1.01k forks source link

Reference implementation of bitfield #64

Closed gftea closed 1 year ago

gftea commented 1 year ago

Hi @dtolnay @alexcrichton , any reference implementation for bitfield? I am stucked at 04-multiple-of-8bits, which I do not know how to emit codes based on #size % 8, because we can't resolve the actual value from the expression in proc-macro,

dtolnay commented 1 year ago

You could try taking your question to any of the resources shown in https://www.rust-lang.org/community. Syn is one of the most widely used Rust libraries so plenty of people should be able to provide guidance.

You could also try searching through forks of this repo since some people push their work to GitHub, but this is not the intended way to consume the workshop.