Skip to content

-C check-cfg emits compile errors #7

Closed
@daxpedda

Description

With -C check-cfg stabilized in Cargo v1.80 and enabled by default (see rust-lang/cargo#13571), newly introduced cfgs will emit compile errors when used inside the crate.

The solution is to emit cargo:rustc-check-cfg=cfg(your_cfg) inside the build.rs to register the new cfgs, this will emit warnings in older versions of Rust because the feature is not stable, but at least it won't emit errors in Rust v1.80 (or currently nightly).

See the -C check-cfg and the accompanying rustc-check-cfg documentation.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions