Skip to content

Unexpected Warning on Rust 1.86.0 #13

Description

@zicklag

Hi, I'm getting

warning: unexpected `cfg` condition name: `my_cfg_name`
    --> redis/src/my_code.rs:1653:23
     |
1653 |                 #[cfg(my_cfg_name)]
     |                       ^^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = help: consider using a Cargo feature instead
     = help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint:
              [lints.rust]
              unexpected_cfgs = { level = "warn", check-cfg = ['cfg(my_cfg_name)'] }
     = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(my_cfg_name)");` to the top of the `build.rs`
     = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration

warning: `redis` (lib) generated 10 warnings

when using rustc 1.86.0 to compile a library crate. It's not that bad, because the fix is in the warning, but it still would be nice if it was avoided.

Originally posted by @nihohit in #10 (comment)

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