4 ms·
This is specific to asm!. It is a macro, and you can use macros to implement custom syntactic constructs.
by yberreby 5y ago
This is specific to asm!. It is a macro, and you can use macros to implement custom syntactic constructs.
- tikkabhuna 5y agoThanks! I'll have to take a look at the Macros section of the book.
- kibwen 5y agoSee also the documentation on inline assembly here: https://doc.rust-lang.org/nightly/reference/inline-assembly.html https://doc.rust-lang.org/nightly/reference/inline-assembly.... .
- alpaca128 5y agoThe Little Book of Rust Macros[0] is also worth a look imho, it helped me a lot when I started learning macros. [0] https://veykril.github.io/tlborm/introduction.html https://veykril.github.io/tlborm/introduction.html
- ostenning 5y agoThanks! Been using rust for a while now and macros seem to be kind of like the final Frontier of Rust development
- alpaca128 5y agoI don't have any problems with macros but I still don't get traits & trait objects. The combination of weird syntax, error messages and unexpected limitations confuses me every time. I'm getting the impression that abstraction isn't quite my thing. Luckily there's still enums. Not as flexible but they make sense to me and don't sprinkle annotation boilerplate everywhere.