I am relatively new to rust and am currently trying to translate a structure to rust - but am running into what feels like a bug but probably is a lack of understanding of macros.
The issue is best explained in Rust Playground (rust-lang.org) which is a commented "minimal example".
In short I am trying to write a macro that will let me (efficiently and with clear code) run a closure over a set of curves.
Ref the link above I have two questions:
- Why does the original code not compile - is it because the type checker is run before the macro expansion?
- If commenting out lines 72 & 73 -> why is the result not as expected? Surely the inner "x" should here shadow the outer one?
Thanks for any pointers