Open
Description
I tried this code: rustc -Z allow-features= -Z always-encode-mir
I expected to see this happen: rustc gives a hard error that always-encode-mir
was not listed in allow-features
.
Instead, this happened: rustc silently accepts the -Z flag.
It feels very natural to me that this should apply to flags, not just source code, by the same logic you'd want it anywhere: it gives the person running the build control over what unstable features they use, instead of unknowingly enabling features from the myriad sources that cargo picks up rustflags.
Meta
rustc --version --verbose
:
rustc 1.87.0-nightly (43f0014ef 2025-03-25)