I hacked up something similar (https://gitlab.com/mbryant/functiontrace/-/blob/master/src/p...) a while ago. Your variant looks much more useful!
Re:The compiler will optimize that away
by conradludgate on Sunday May 02, 2021 @07:07AM
(#27014109)
Yeah I'm a big fan of proc-macros. If utilised well, it can do some really great things
[0]: https://crates.io/crates/soa_derive