Skip to content

Dashmap failing to build: -Z unstable-options must be passed to enable the flag check-cfg #342

@Feelfeel20088

Description

@Feelfeel20088

Full error:
error: the -Z unstable-options flag must also be passed to enable the flag check-cfg

error: could not compile dashmap (lib)

Caused by:
process didn't exit successfully: rustc --crate-name dashmap --edition=2018 /home/felix/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dashmap-5.5.3/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=140 --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 --cfg 'feature="serde"' --check-cfg 'cfg(docsrs)' --check-cfg 'cfg(feature, values("arbitrary", "inline", "raw-api", "rayon", "serde"))' -C metadata=b9b234beed69a4da -C extra-filename=-b9b234beed69a4da --out-dir /home/felix/projects/discord_bot/target/debug/deps -L dependency=/home/felix/projects/discord_bot/target/debug/deps --extern cfg_if=/home/felix/projects/discord_bot/target/debug/deps/libcfg_if-57bf25c23e31efdb.rmeta --extern hashbrown=/home/felix/projects/discord_bot/target/debug/deps/libhashbrown-17cd557bcbec3b2d.rmeta --extern lock_api=/home/felix/projects/discord_bot/target/debug/deps/liblock_api-e2cb0d427dfba242.rmeta --extern once_cell=/home/felix/projects/discord_bot/target/debug/deps/libonce_cell-7d8771cc0add5777.rmeta --extern parking_lot_core=/home/felix/projects/discord_bot/target/debug/deps/libparking_lot_core-067242789b593025.rmeta --extern serde=/home/felix/projects/discord_bot/target/debug/deps/libserde-9e181778b6c34c91.rmeta --cap-lints allow (exit status: 1)

warning: build failed, waiting for other jobs to finish...

Related issue: surrealdb/surrealdb#5030 (still open)

I'm a beginner in Rust and trying to compile serenity. I get this downstream error when compiling. I am on NixOS, which may be the problem (the related issue has people on NixOS experiencing the same issue).

Things I have tried:

  • Switching to the nightly toolchain.
  • Adding build flags in .cargo/config.toml:

[build]
rustdocflags = [
"--cfg", "docsrs",
"-Z", "unstable-options",
"--enable-per-target-ignores"
]
there is probably a very simple fix i appreciate anyone who helps :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions