Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(linux): fix warnings from unexpected_cfgs lint on nightly #1280

Merged
merged 1 commit into from
May 30, 2024

Conversation

rhysd
Copy link
Contributor

@rhysd rhysd commented May 30, 2024

Recently nightly rustc enabled unexpected_cfgs lint by default. Since this project uses non-standard cfg names, they started to cause warnings like below on Linux:

warning: unexpected `cfg` condition name: `gtk`
    --> src/lib.rs:1029:17
     |
1029 |       #[cfg(not(gtk))]
     |                 ^^^
     |
     = 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(gtk)'] }
     = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(gtk)");` 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

I didn't add a change file since this happens only on nightly yet. I confirmed those warnings were fixed on cargo +nightly check and also confirmed cargo check passed same as before.

Ref: rust-lang/rust#82450

Recently nightly `rustc` enabled `unexpected_cfgs` lint by default.
Since this project uses non-standard cfg names, they started to cause
warnings like below on Linux:

```
warning: unexpected `cfg` condition name: `gtk`
    --> src/lib.rs:1029:17
     |
1029 |       #[cfg(not(gtk))]
     |                 ^^^
     |
     = 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(gtk)'] }
     = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(gtk)");` 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
```

Ref: rust-lang/rust#82450

Signed-off-by: rhysd <lin90162@yahoo.co.jp>
@rhysd rhysd requested a review from a team as a code owner May 30, 2024 04:55
@pewsheen pewsheen merged commit 4c42a03 into tauri-apps:dev May 30, 2024
13 checks passed
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.

2 participants