O'Reilly logo

Mastering Rust by Vesa Kaihlavirta

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Compiler Plugins

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required