Code compiles on playground but fails when passed via stdin to rustc
MusicalNinjaDad:
So, what's the concern about a build probe which correctly reacts to
RUSTFLAGS="-Zallow-features="by not enabling any nightly features?
Basically every build probe is broken in subtle ways. It's not currently possible to construct a correct build probe, cargo does not provide enough information.
autocfg is about as good as it gets, but a lot of crates roll their own build probes and many of them are ways worse. By asking about "a correct build probe" you are asking about a hypothetical alternative universe. In practice, a large fraction of build probes are broken.
And even perfect build probes still have the wrong polarity: nightly features should be opt-in, not opt-out. That's how the entire Rust nightly feature system is designed. I shouldn't have to set an env var that says "please actually give me a reliable developer experience where I can update my compiler without breaking the build". Defaulting to "unreliable developer experience" is a terrible default. It is frustrating to see that principle constantly violated by a small set of crates, to the detriment of nightly users and compiler maintainers that want to do normal nightly feature development (i.e., change/break how nightly feature work) or that need to debug regressions.
I understand that there's an actual need here from the side of crate developers. But instead of running ahead with a broken non-solution, I would have hoped there would be some attempt at doing something standardized that actually works for everyone involved. Sadly, to my knowledge, that was never even attempted. Now my best hope is that we do get global features in cargo and we can standardize on a global feature to control whether crates should use nightly features that they don't strictly need.
Discussion in the ATmosphere