Skip to content

Add a way to conditionally compile things when a config item is _not_ present #1724

Closed
@brson

Description

@brson

A number of times I have wanted to use one function in one configuration in another in all other configurations. There's just no way to express this currently. A simple way to implement it would be with a #[notcfg(...)] attribute, which would just do the opposite of #[cfg(...)].

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-attributesArea: Attributes (`#[…]`, `#![…]`)A-frontendArea: Compiler frontend (errors, parsing and HIR)E-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