External Publication
Visit Post

Code compiles on playground but fails when passed via stdin to rustc

Rust Internals [Unofficial] June 29, 2026
Source

As the person choosing the toolchain to build with, I may be using nightly for any number of reasons; in particular, I may be using it to get access to flags useful for debugging that aren't stable, or to use a newer compiler version that might have fixed a bug.

When I switch to nightly for one of those reasons, I don't want my project's dependencies to also implicitly change to making use of unstable features. I don't want them to be compiling different code. I don't want them to be exercising parts of the compiler that are marked unstable. I want everything about those dependencies to be exactly the same except what I chose to change (the compiler version) so that the results of my experiment are as controlled as possible.

That said, I would also enjoy having a sort of global feature flag (perhaps just a conventional environment variable, or cfg to stick in RUSTFLAGS?) to tell every dependency "yes, do use all the unstable features you would like to", for the testing of nightly features. But I don't want that to be implied by any usage of nightly at all, which is what happens when libraries use build probes for unstable features.

Discussion in the ATmosphere

Loading comments...