The other form of metaprogramming, compiler plugins, enable arbitrary Rust code to be run at compile time. This feature is the only one in this book that has not hit the stable version of Rust yet (and perhaps never will in this form), but it is still quite widely used and an important differentiating feature that should be covered.
Expect a level of thickness and uncertainty in this chapter; compiler plugins are a challenging feature and their Rust implementation is still quite unstable. The concepts should be fairly stable, but the implementation details may very well be different even just a year after the publication date.
In this chapter, we will cover the following topics:
- Minimal compiler plugin
- Cargo integration ...