6

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?

kmdreko
  • 42,554
  • 6
  • 57
  • 106
Daniel Fath
  • 16,453
  • 7
  • 47
  • 82
  • 1
    As of now, the discussion in the [plugin tracking issue](https://github.com/rust-lang/rust/issues/29597) indicates that the feature is on the table for deprecation and removal. – kmdreko Sep 20 '22 at 20:07

1 Answers1

7

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.

llogiq
  • 13,815
  • 8
  • 40
  • 72
  • What about: https://internals.rust-lang.org/t/pre-rfc-stablized-syntax-extensions-sort-of/2259/12 ? Was there an effort to allow syntax extension exporting? – Daniel Fath Sep 18 '15 at 15:16
  • Yes, but it seems to be a) stalled, and b) severely limited. – llogiq Sep 18 '15 at 15:58