dtolnay / proc-macro-workshop

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

Finish bitfield test suite #15

Closed dtolnay closed 5 years ago

dtolnay commented 5 years ago

Fixes #7.

dtolnay commented 5 years ago

FYI @Robbepop

Robbepop commented 5 years ago

Are you going to add solutions to the workshop items to have a go-to when they are stuck or do you accept such solutions? They could for example live in another branch.

I am especially interested in what you mean by:

techniques for compile-time assertions that require type information, by leveraging the trait system in interesting ways from generated code;

In the bitfield macro description.

dtolnay commented 5 years ago

I keep public reference solutions for all five projects in GitHub if you know where to look, but I wouldn't want them to be listed as branches. I would prefer that people file issues when stuck so that I find out what content needs to be improved.

Robbepop commented 5 years ago

I really like the test-driven specification by this PR - it gave me a much better understanding of how the interfaces are meant to work towards the user facing side. Maybe I will give it a try. :)

Edit: Don't you intent to publish the bitfield crate to crates.io? I think it is super useful and personally I would prefer it over the alternatives.