Skip to content

--cfg accepts invalid cfgs #31495

Closed
Closed
@brson

Description

@brson

List meta items are not allowed in cfg specs because the compiler reserves them for built-in predicates like any.

So for example you can't write

foo.rs:1:7: 1:16 error: invalid predicate `foo`
foo.rs:1 #[cfg(foo(bar))]
               ^~~~~~~~~

You can though write `rustc --cfg "foo(bar))". This should be similarly rejected.

cc #31278

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-driverArea: rustc_driver that ties everything together into the `rustc` compilerE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions