Skip to content

Conversation

@ErichDonGubler
Copy link

No description provided.

@zicklag
Copy link
Member

zicklag commented Aug 13, 2024

I was on the fence about whether we should check the Rust version and asked about that in #7 (comment), but @ogoffart and @Urgau were of the opinion that it probably wasn't necessary to do the check.

If we do the check, I think we can do it like in this comment #7 (comment), like the semver crate, instead of adding another dependency, since it's just a tiny function necessary to parse the version.

If this is something that WGPU needs, then I think we should just do the check, but I'd like to give the opportunity for comments before merging.

@ErichDonGubler
Copy link
Author

WGPU could just wait until its MSRV is high enough to avoid warnings, and then upgrade. There aren't other features from this crate that we consume, so 🤷🏻‍♂️ I wouldn't be devastated if this PR were simply closed.

@ogoffart
Copy link
Contributor

Pro this change:

  • hides warning for people trying to compile the directly dependent crate with an old version of rust

Cons:

  • adds a dependency, that calls rustc to know the version, making the build a tiny bit slower.

One could argue that the build time is probably negligible.

But on the other hand, these warnings are only shown for some old version of rustc, they are not shown for dependencies (i.e, if someone use wgpu from crates.io, they won't see the warnings because of the caps-lint) and cargo warnings can't be turned into error on the CI.

@zicklag
Copy link
Member

zicklag commented Sep 5, 2024

For now I'm leaning towards just leaving this be in favor of keeping this crate as 100% minimal and "guilt-free" as possible, but I don't have strong opinions on this change, so if anybody feels that this should definitely be done, feel free to comment and we'll get it fixed.

@nihohit
Copy link

nihohit commented Apr 15, 2025

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.

@zicklag
Copy link
Member

zicklag commented Apr 16, 2025

@nihohit I opened #13 to discuss that. It appears to be a different issue.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants