0

I realise this has been asked before and the answer was to use the -Z option with rustc, but that only works with the nightly build of Rust as of Rust 1.31.

Is there an alternative when using the stable build?

Shepmaster
  • 388,571
  • 95
  • 1,107
  • 1,366
John
  • 1,593
  • 3
  • 17
  • 28

1 Answers1

1

No, there is not. This is only available on nightly Rust.

When using rustup, however, there's no reason to not have both stable and nightly Rust installed. You can then just do rustc +nightly -Z ..., continuing to compile your code with stable.

See also:

Shepmaster
  • 388,571
  • 95
  • 1,107
  • 1,366
  • thanks for this. What is the reason for not being able to see expanded macros in the stable build? – John Jan 30 '19 at 16:37
  • @John See [issue #43364](https://github.com/rust-lang/rust/issues/43364) for a full discussion. One primary reason I know of is that the expanded code might not even compile — it's not guaranteed to have the same semantics as the original code. – Shepmaster Jan 30 '19 at 16:40