Skip to content

debug_assertions not supported for selecting dependencies and will not work as expected #874

@BlinkyStitt

Description

@BlinkyStitt

I'm following these docs: https://github.com/RustAudio/cpal/wiki/Setting-up-a-new-CPAL-WASM-project

I added this to my Cargo.toml

# The `console_error_panic_hook` crate provides better debugging of panics by
# logging them with `console.error`. This is great for development, but requires
# all the `std::fmt` and `std::panicking` infrastructure, so it's only enabled
# in debug mode.
[target."cfg(debug_assertions)".dependencies]
console_error_panic_hook = "0.1.5"

But it gives this warning:

warning: Found `debug_assertions` in `target.'cfg(...)'.dependencies`. This value is not supported for selecting dependencies and will not work as expected. To learn more visit https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#platform-specific-dependencies

Sadly, that doc says "There is currently no way to add dependencies based on these configuration values."

I think a feature needs to be used instead.

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