Skip to content

if multiple -Z allow-features are passed, only the last is used #139947

Open
@jyn514

Description

@jyn514

I tried this code:

rustc +nightly -Zallow-features=ffi_pure -Z allow-features=rustc_attrs src/main.rs

I expected to see this happen: A hard error. It does not make sense to combine allow-features; should they be OR-d or AND-ed?

Instead, this happened: Neither an OR nor an AND. Instead the first flag was ignored altogether.

error[E0725]: the feature `ffi_pure` is not in the list of allowed features
 --> src/main.rs:2:12
  |
2 | #![feature(ffi_pure, rustc_private)]
  |            ^^^^^^^^

Meta

rustc --version --verbose: rustc 1.88.0-nightly (78f2104 2025-04-16)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-CLIArea: Command-line interface (CLI) to the compilerC-bugCategory: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.requires-nightlyThis issue requires a nightly compiler in some way.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions