rustrust-compiler-plugin

Can I use compiler plugins on stable Rust?


The thing I'm trying to make requires plugin compiler, because I need error reporting at compile time, however I'd like for it to run on Rust stable and not just nightly.

Is there a way to run compiler plugins on stable Rust?


Solution

  • Not yet; compiler plugins rely on an unstable API that is very much in flux. While it's impossible to foretell when the APIs stabilize, I think we'll see a good number of Rust versions before those APIs can be declared stable.

    A good workaround for things that only need ASTs is to use syntex and build your own program independent of rustc.