-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-CLIArea: Command-line interface (CLI) to the compilerArea: Command-line interface (CLI) to the compilerA-stabilityArea: `#[stable]`, `#[unstable]` etc.Area: `#[stable]`, `#[unstable]` etc.C-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
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)
Metadata
Metadata
Assignees
Labels
A-CLIArea: Command-line interface (CLI) to the compilerArea: Command-line interface (CLI) to the compilerA-stabilityArea: `#[stable]`, `#[unstable]` etc.Area: `#[stable]`, `#[unstable]` etc.C-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.