Skip to content

derive macro warning: unexpected cfg condition name: wasm_bindgen_unstable_test_coverage #4283

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

Closed
mirsella opened this issue Nov 20, 2024 · 6 comments
Labels

Comments

@mirsella
Copy link

version: wasm-bindgen v0.2.95
Recent rust nightly version enabled by default the unexpected_cfgs, which lead to this warning:

warning: unexpected `cfg` condition name: `wasm_bindgen_unstable_test_coverage`
  --> game/src/lib.rs:29:1
   |
29 | #[wasm_bindgen]
   | ^^^^^^^^^^^^^^^
   |
   = 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(wasm_bindgen_unstable_test_coverage)'] }
   = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(wasm_bindgen_unstable_test_coverage)");` 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: this warning originates in the attribute macro `wasm_bindgen` (in Nightly builds, run with -Z macro-backtrace for more info)
@bcheidemann
Copy link

For anyone else coming across this, you can statically declare the cfg as expected by adding the following to your Cargo.toml:

[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(wasm_bindgen_unstable_test_coverage)'] }

@daxpedda
Copy link
Collaborator

Fixed by #4284.

@mirsella
Copy link
Author

nice, that's a better fix than just ignoring the lint

@mirsella
Copy link
Author

since this can break CI by emitting a warning to potentially a lot of people, it would be nice to have a patch release
thanks and have a good day :)

@daxpedda
Copy link
Collaborator

since this can break CI by emitting a warning to potentially a lot of people, it would be nice to have a patch release thanks and have a good day :)

I plan to make one today or at the latest tomorrow.

Maximkaaa added a commit to Maximkaaa/galileo that referenced this issue Jan 13, 2025
When using nightly version of the compiler, building for wasm32 target
emits a bunch of warnings rooted in the `wasm_bindgen` macro:

```
warning: unexpected `cfg` condition name: `wasm_bindgen_unstable_test_coverage`
```

This commit prevents this noise by following the suggestion from the
related `wasm_bindgen` issue:
[rustwasm/wasm-bindgen#4283].
Maximkaaa added a commit to Maximkaaa/galileo that referenced this issue Jan 13, 2025
When using nightly version of the compiler, building for wasm32 target
emits a bunch of warnings rooted in the `wasm_bindgen` macro:

```
warning: unexpected `cfg` condition name: `wasm_bindgen_unstable_test_coverage`
```

This commit prevents this noise by following the suggestion from the
related `wasm_bindgen` issue:
[rustwasm/wasm-bindgen#4283].
@MingweiSamuel

This comment was marked as resolved.

conorsch added a commit to penumbra-zone/web that referenced this issue Jan 17, 2025
Recently, CI jobs started failing on the `rust:lint` step.
One suitable workaround was to ignore the questionable lints
via Cargo.toml:

```
[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(wasm_bindgen_unstable_test_coverage)'] }
```

However we can just bump the dep and skip ignoring the lints. See
related discussion in [0].

[0] rustwasm/wasm-bindgen#4283
conorsch added a commit to penumbra-zone/web that referenced this issue Jan 17, 2025
Recently, CI jobs started failing on the `rust:lint` step.
One suitable workaround was to ignore the questionable lints
via Cargo.toml:

```
[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(wasm_bindgen_unstable_test_coverage)'] }
```

This seems to resolve. I also tried bumping the `wasm-bindgen` dep to
0.2.100, which didn't resolve on its own. See related discussion in [0].

[0] rustwasm/wasm-bindgen#4283
conorsch added a commit to penumbra-zone/web that referenced this issue Jan 17, 2025
Recently, CI jobs started failing on the `rust:lint` step.
One suitable workaround was to ignore the questionable lints
via Cargo.toml:

```
[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(wasm_bindgen_unstable_test_coverage)'] }
```

This seems to resolve. I also tried bumping the `wasm-bindgen` dep to
0.2.100, which didn't resolve on its own. See related discussion in [0].

[0] rustwasm/wasm-bindgen#4283
conorsch added a commit to penumbra-zone/web that referenced this issue Jan 17, 2025
Recently, CI jobs started failing on the `rust:lint` step.
One suitable workaround was to ignore the questionable lints
via Cargo.toml:

```
[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(wasm_bindgen_unstable_test_coverage)'] }
```

This seems to resolve. I also tried bumping the `wasm-bindgen` dep to
0.2.100, which didn't resolve on its own. See related discussion in [0].

[0] rustwasm/wasm-bindgen#4283
TalDerei pushed a commit to penumbra-zone/web that referenced this issue Mar 6, 2025
Recently, CI jobs started failing on the `rust:lint` step.
One suitable workaround was to ignore the questionable lints
via Cargo.toml:

```
[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(wasm_bindgen_unstable_test_coverage)'] }
```

This seems to resolve. I also tried bumping the `wasm-bindgen` dep to
0.2.100, which didn't resolve on its own. See related discussion in [0].

[0] rustwasm/wasm-bindgen#4283
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants