wgpu icon indicating copy to clipboard operation
wgpu copied to clipboard

Unexpected `cfg` condition warnings for cfgs defined by `build.rs`

Open White-Rabbit-Scientific opened this issue 1 year ago • 4 comments

It does compile and run ! but with the following issues that I don't understand.

cargo run --release --bin wgpu-examples boids

warning: unexpected `cfg` condition name: `dot_out`
 --> naga/src/back/mod.rs:8:7
  |
8 | #[cfg(dot_out)]
  |       ^^^^^^^
  |
  = help: expected names are: `clippy`, `debug_assertions`, `doc`, `docsrs`, `doctest`, `feature`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `sanitize`, `sanitizer_cfi_generalize_pointers`, `sanitizer_cfi_normalize_integers`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `test`, `ub_checks`, `unix`, and `windows`
  = 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(dot_out)'] }
  = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(dot_out)");` 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
  = note: `#[warn(unexpected_cfgs)]` on by default

warning: unexpected `cfg` condition name: `glsl_out`
  --> naga/src/back/mod.rs:10:7
   |
10 | #[cfg(glsl_out)]
   |       ^^^^^^^^
   |
   = 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(glsl_out)'] }
   = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(glsl_out)");` 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: unexpected `cfg` condition name: `hlsl_out`
  --> naga/src/back/mod.rs:12:7
   |
12 | #[cfg(hlsl_out)]
   |       ^^^^^^^^
   |
   = 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(hlsl_out)'] }
   = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(hlsl_out)");` 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: unexpected `cfg` condition name: `msl_out`
  --> naga/src/back/mod.rs:14:7
   |
14 | #[cfg(msl_out)]
   |       ^^^^^^^
   |
   = 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(msl_out)'] }
   = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(msl_out)");` 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: unexpected `cfg` condition name: `spv_out`
  --> naga/src/back/mod.rs:16:7
   |
16 | #[cfg(spv_out)]
   |       ^^^^^^^
   |
   = 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(spv_out)'] }
   = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(spv_out)");` 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: unexpected `cfg` condition name: `wgsl_out`
  --> naga/src/back/mod.rs:18:7
   |
18 | #[cfg(wgsl_out)]
   |       ^^^^^^^^
   |
   = 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(wgsl_out)'] }
   = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(wgsl_out)");` 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: unexpected `cfg` condition name: `hlsl_out`
  --> naga/src/back/mod.rs:21:11
   |
21 | #[cfg(any(hlsl_out, msl_out, spv_out, glsl_out))]
   |           ^^^^^^^^
   |
   = 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(hlsl_out)'] }
   = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(hlsl_out)");` 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: unexpected `cfg` condition name: `msl_out`
  --> naga/src/back/mod.rs:21:21
   |
21 | #[cfg(any(hlsl_out, msl_out, spv_out, glsl_out))]
   |                     ^^^^^^^
   |
   = 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(msl_out)'] }
   = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(msl_out)");` 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: unexpected `cfg` condition name: `spv_out`
  --> naga/src/back/mod.rs:21:30
   |
21 | #[cfg(any(hlsl_out, msl_out, spv_out, glsl_out))]
   |                              ^^^^^^^
   |
   = 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(spv_out)'] }
   = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(spv_out)");` 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: unexpected `cfg` condition name: `glsl_out`
  --> naga/src/back/mod.rs:21:39
   |
21 | #[cfg(any(hlsl_out, msl_out, spv_out, glsl_out))]
   |                                       ^^^^^^^^
   |
   = 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(glsl_out)'] }
   = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(glsl_out)");` 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: unexpected `cfg` condition name: `hlsl_out`
  --> naga/src/back/mod.rs:24:11
   |
24 | #[cfg(any(hlsl_out, glsl_out))]
   |           ^^^^^^^^
   |
   = 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(hlsl_out)'] }
   = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(hlsl_out)");` 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: unexpected `cfg` condition name: `glsl_out`
  --> naga/src/back/mod.rs:24:21
   |
24 | #[cfg(any(hlsl_out, glsl_out))]
   |                     ^^^^^^^^
   |
   = 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(glsl_out)'] }
   = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(glsl_out)");` 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: unexpected `cfg` condition name: `wgsl_out`
    --> naga/src/front/spv/mod.rs:5913:38
     |
5913 | #[cfg(all(test, feature = "wgsl-in", wgsl_out))]
     |                                      ^^^^^^^^
     |
     = 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(wgsl_out)'] }
     = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(wgsl_out)");` 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: unexpected `cfg` condition name: `wgsl_out`
 --> naga/src/keywords/mod.rs:5:32
  |
5 | #[cfg(any(feature = "wgsl-in", wgsl_out))]
  |                                ^^^^^^^^
  |
  = 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(wgsl_out)'] }
  = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(wgsl_out)");` 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: `naga` (lib) generated 14 warnings
warning: unexpected `cfg` condition name: `dx12`
   --> wgpu-hal/src/lib.rs:238:7
    |
238 | #[cfg(dx12)]
    |       ^^^^ help: found config with similar value: `feature = "dx12"`
    |
    = help: expected names are: `clippy`, `debug_assertions`, `doc`, `docsrs`, `doctest`, `feature`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `sanitize`, `sanitizer_cfi_generalize_pointers`, `sanitizer_cfi_normalize_integers`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `test`, `ub_checks`, `unix`, and `windows`
    = 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(dx12)'] }
    = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(dx12)");` 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
    = note: `#[warn(unexpected_cfgs)]` on by default

warning: unexpected `cfg` condition name: `gles`
   --> wgpu-hal/src/lib.rs:243:7
    |
243 | #[cfg(gles)]
    |       ^^^^ help: found config with similar value: `feature = "gles"`
    |
    = 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(gles)'] }
    = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(gles)");` 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: unexpected `cfg` condition name: `metal`
   --> wgpu-hal/src/lib.rs:246:7
    |
246 | #[cfg(metal)]
    |       ^^^^^ help: found config with similar value: `feature = "metal"`
    |
    = 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(metal)'] }
    = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(metal)");` 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: unexpected `cfg` condition name: `vulkan`
   --> wgpu-hal/src/lib.rs:249:7
    |
249 | #[cfg(vulkan)]
    |       ^^^^^^ help: found config with similar value: `feature = "vulkan"`
    |
    = 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(vulkan)'] }
    = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(vulkan)");` 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: unexpected `cfg` condition name: `gles`
   --> wgpu-hal/src/lib.rs:307:11
    |
307 | #[cfg(any(gles, vulkan))]
    |           ^^^^ help: found config with similar value: `feature = "gles"`
    |
    = 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(gles)'] }
    = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(gles)");` 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: unexpected `cfg` condition name: `vulkan`
   --> wgpu-hal/src/lib.rs:307:17
    |
307 | #[cfg(any(gles, vulkan))]
    |                 ^^^^^^ help: found config with similar value: `feature = "vulkan"`
    |
    = 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(vulkan)'] }
    = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(vulkan)");` 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: unexpected `cfg` condition name: `gles`
   --> wgpu-hal/src/lib.rs:310:11
    |
310 | #[cfg(any(gles, vulkan))]
    |           ^^^^ help: found config with similar value: `feature = "gles"`
    |
    = 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(gles)'] }
    = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(gles)");` 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: unexpected `cfg` condition name: `vulkan`
   --> wgpu-hal/src/lib.rs:310:17
    |
310 | #[cfg(any(gles, vulkan))]
    |                 ^^^^^^ help: found config with similar value: `feature = "vulkan"`
    |
    = 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(vulkan)'] }
    = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(vulkan)");` 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: unexpected `cfg` condition name: `gles`
   --> wgpu-hal/src/lib.rs:315:15
    |
315 | #[cfg(all(any(gles, vulkan), any(native, Emscripten)))]
    |               ^^^^ help: found config with similar value: `feature = "gles"`
    |
    = 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(gles)'] }
    = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(gles)");` 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: unexpected `cfg` condition name: `vulkan`
   --> wgpu-hal/src/lib.rs:315:21
    |
315 | #[cfg(all(any(gles, vulkan), any(native, Emscripten)))]
    |                     ^^^^^^ help: found config with similar value: `feature = "vulkan"`
    |
    = 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(vulkan)'] }
    = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(vulkan)");` 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: unexpected `cfg` condition name: `native`
   --> wgpu-hal/src/lib.rs:315:34
    |
315 | #[cfg(all(any(gles, vulkan), any(native, Emscripten)))]
    |                                  ^^^^^^
    |
    = 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(native)'] }
    = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(native)");` 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: unexpected `cfg` condition name: `Emscripten`
   --> wgpu-hal/src/lib.rs:315:42
    |
315 | #[cfg(all(any(gles, vulkan), any(native, Emscripten)))]
    |                                          ^^^^^^^^^^
    |
    = 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(Emscripten)'] }
    = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(Emscripten)");` 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: unexpected `cfg` condition name: `gles`
   --> wgpu-hal/src/lib.rs:322:11
    |
322 | #[cfg(any(gles, vulkan))]
    |           ^^^^ help: found config with similar value: `feature = "gles"`
    |
    = 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(gles)'] }
    = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(gles)");` 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: unexpected `cfg` condition name: `vulkan`
   --> wgpu-hal/src/lib.rs:322:17
    |
322 | #[cfg(any(gles, vulkan))]
    |                 ^^^^^^ help: found config with similar value: `feature = "vulkan"`
    |
    = 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(vulkan)'] }
    = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(vulkan)");` 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: unexpected `cfg` condition name: `gles`
   --> wgpu-hal/src/lib.rs:329:11
    |
329 | #[cfg(any(gles, vulkan))]
    |           ^^^^ help: found config with similar value: `feature = "gles"`
    |
    = 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(gles)'] }
    = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(gles)");` 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: unexpected `cfg` condition name: `vulkan`
   --> wgpu-hal/src/lib.rs:329:17
    |
329 | #[cfg(any(gles, vulkan))]
    |                 ^^^^^^ help: found config with similar value: `feature = "vulkan"`
    |
    = 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(vulkan)'] }
    = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(vulkan)");` 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: unexpected `cfg` condition name: `webgl`
   --> wgpu-hal/src/empty.rs:343:11
    |
343 |     #[cfg(webgl)]
    |           ^^^^^
    |
    = 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(webgl)'] }
    = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(webgl)");` 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: unexpected `cfg` condition name: `webgl`
  --> wgpu-hal/src/gles/mod.rs:85:24
   |
85 | #[cfg(not(any(windows, webgl)))]
   |                        ^^^^^
   |
   = 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(webgl)'] }
   = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(webgl)");` 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: unexpected `cfg` condition name: `Emscripten`
  --> wgpu-hal/src/gles/mod.rs:87:7
   |
87 | #[cfg(Emscripten)]
   |       ^^^^^^^^^^
   |
   = 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(Emscripten)'] }
   = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(Emscripten)");` 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: unexpected `cfg` condition name: `webgl`
  --> wgpu-hal/src/gles/mod.rs:89:7
   |
89 | #[cfg(webgl)]
   |       ^^^^^
   |
   = 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(webgl)'] }
   = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(webgl)");` 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: unexpected `cfg` condition name: `webgl`
   --> wgpu-hal/src/gles/mod.rs:102:24
    |
102 | #[cfg(not(any(windows, webgl)))]
    |                        ^^^^^
    |
    = 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(webgl)'] }
    = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(webgl)");` 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: unexpected `cfg` condition name: `webgl`
   --> wgpu-hal/src/gles/mod.rs:104:24
    |
104 | #[cfg(not(any(windows, webgl)))]
    |                        ^^^^^
    |
    = 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(webgl)'] }
    = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(webgl)");` 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: unexpected `cfg` condition name: `webgl`
   --> wgpu-hal/src/gles/mod.rs:107:7
    |
107 | #[cfg(webgl)]
    |       ^^^^^
    |
    = 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(webgl)'] }
    = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(webgl)");` 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: unexpected `cfg` condition name: `webgl`
   --> wgpu-hal/src/gles/mod.rs:109:7
    |
109 | #[cfg(webgl)]
    |       ^^^^^
    |
    = 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(webgl)'] }
    = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(webgl)");` 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: unexpected `cfg` condition name: `send_sync`
   --> wgpu-hal/src/gles/mod.rs:329:7
    |
329 | #[cfg(send_sync)]
    |       ^^^^^^^^^
    |
    = 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(send_sync)'] }
    = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(send_sync)");` 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: unexpected `cfg` condition name: `send_sync`
   --> wgpu-hal/src/gles/mod.rs:331:7
    |
331 | #[cfg(send_sync)]
    |       ^^^^^^^^^
    |
    = 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(send_sync)'] }
    = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(send_sync)");` 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: unexpected `cfg` condition name: `send_sync`
   --> wgpu-hal/src/gles/mod.rs:352:7
    |
352 | #[cfg(send_sync)]
    |       ^^^^^^^^^
    |
    = 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(send_sync)'] }
    = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(send_sync)");` 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: unexpected `cfg` condition name: `send_sync`
   --> wgpu-hal/src/gles/mod.rs:354:7
    |
354 | #[cfg(send_sync)]
    |       ^^^^^^^^^
    |
    = 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(send_sync)'] }
    = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(send_sync)");` 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

// ---SNIP --- to fit 65535 character limit

warning: unexpected `cfg` condition name: `wgpu_core`
 --> wgpu/src/util/init.rs:5:7
  |
5 | #[cfg(wgpu_core)]
  |       ^^^^^^^^^
  |
  = 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(wgpu_core)'] }
  = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(wgpu_core)");` 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: unexpected `cfg` condition name: `wgpu_core`
 --> wgpu/src/util/init.rs:9:11
  |
9 | #[cfg(not(wgpu_core))]
  |           ^^^^^^^^^
  |
  = 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(wgpu_core)'] }
  = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(wgpu_core)");` 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: unexpected `cfg` condition name: `native`
  --> wgpu/src/util/init.rs:41:7
   |
41 | #[cfg(native)]
   |       ^^^^^^
   |
   = 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(native)'] }
   = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(native)");` 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: unexpected `cfg` condition name: `native`
  --> wgpu/src/util/init.rs:73:11
   |
73 | #[cfg(not(native))]
   |           ^^^^^^
   |
   = 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(native)'] }
   = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(native)");` 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: `wgpu` (lib) generated 163 warnings
    Finished `release` profile [optimized + debuginfo] target(s) in 0.24s
     Running `target/release/wgpu-examples boids`
[2024-10-01T03:24:52Z WARN  sctk_adwaita::buttons] Ignoring unknown button type: 
[2024-10-01T03:24:52Z INFO  wgpu_examples::framework] Initializing wgpu...
[2024-10-01T03:24:52Z INFO  wgpu_core::instance] Adapter AdapterInfo { name: "Intel(R) HD Graphics 5500 (BDW GT2)", vendor: 32902, device: 5654, device_type: IntegratedGpu, driver: "Intel open-source Mesa driver", driver_info: "Mesa 24.0.9-0ubuntu0.1", backend: Vulkan }
[2024-10-01T03:24:52Z INFO  wgpu_examples::framework] Using Intel(R) HD Graphics 5500 (BDW GT2) (Vulkan)
[2024-10-01T03:24:52Z INFO  wgpu_examples::framework] Entering event loop...
[2024-10-01T03:24:52Z INFO  wgpu_examples::framework] Surface resume PhysicalSize { width: 1193, height: 895 }
[2024-10-01T03:24:52Z INFO  wgpu_examples::framework] Surface resize PhysicalSize { width: 1193, height: 895 }
[2024-10-01T03:24:53Z INFO  wgpu_examples::framework] Frame time 1.25ms (802.3 FPS)

White-Rabbit-Scientific avatar Oct 01 '24 03:10 White-Rabbit-Scientific

It looks like for some reason cargo ignored the rust-toolchain.toml file and compiled with Rust 1.80+ which has these new warnings enabled. Apparently it doesn't pick up those defined by the build.rs, so exceptions need to be added to the respective cargo.toml files:

[lints.rust]
unexpected_cfgs = { ... }

Wumpf avatar Oct 01 '24 07:10 Wumpf

Ah, better! This is fixed in the latest cfg_aliases version https://github.com/katharostech/cfg_aliases/releases/tag/v0.2.1 We'll just have to upgrade. Strange dependabot didn't pick this one up

Wumpf avatar Oct 01 '24 07:10 Wumpf

Thanks. In fact, I had just updated rustc to 1.81 since another crate required it. So yeah...

White-Rabbit-Scientific avatar Oct 01 '24 08:10 White-Rabbit-Scientific

@Wumpf: Upgrading to the latest cfg_aliases brings its own warning/CI breakage.

I have been keeping an open PR to resolve CI warnings for Rust 1.80 at #6105. If you can repro warnings there, LMK!

ErichDonGubler avatar Oct 01 '24 10:10 ErichDonGubler

This should be handled now.

cwfitzgerald avatar Jan 21 '25 14:01 cwfitzgerald