External Publication
Visit Post

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

Rust Internals [Unofficial] June 29, 2026
Source

kpreid:

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.

That makes perfect sense.

kpreid:

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.

With a small twist I'd agree that that is a great idea ...

Why not the other way around? Instead of requiring an opt-in to a full nightly experience on nightly, provide an opt-in-to-only which then disables everything else. That way those who need or want very granular control have it with no extra effort and those who want "full nightly" also have that with no extra effort.

It's the idea of either requiring an opt-in if you don't want granular control, or, worse, if you don't want an arbitrary set of pre-defined features that irks me.

Nemo157:

By surfacing the feature as something the final developer actually enables

and there's the rub ... the final developer cannot enable a feature if they are consuming via a transitive dependency.

Yes - you could require them to set a cfg flag or env variable manually ... and some choose that route. Personally, I prefer a crate that documents clearly if they auto-detect & use nightly features to one that makes me go through that hassle, and choose accordingly (just as others will choose the opposite)

Discussion in the ATmosphere

Loading comments...