I wrote a #rust blog that explores some neat patterns that @rain mentioned on an Oxide and Friends episode. Learn how the Daft crate implements the ability to emit code and errors simultaneously and how they accumulate as many errors as possible for an improved Derive proc-macro experience.
https://schneems.com/2025/03/26/a-daft-procmacro-trick-how-to-emit-partialcode-errors/
@Schneems Thank you, this is wonderful!
Would you like to submit patches for the cases you identified where we could be generating errors? Both seem like good improvements.
I did look at syn's combine but identified the same issue you did — it's easy to do the wrong thing with the ? operator. As I've gotten older I've started trusting my future self less and less
> Would you like to submit patches for the cases you identified where we could be generating errors?
Sure! I'll timebox it and see where I end up. Also I won't be offended or bothered if you (or someone else) beat me to it.
@Schneems Thank you! I won't be offended at all if you put up half done code too, I'm used to people doing that and me finishing it up lol
@rain here's a quick stab at duplicate struct attributes, duplicate field attributes are harder
https://github.com/oxidecomputer/daft/pull/63
@Schneems Great article, thanks for writing this!