Skip to content

Build breaks for --no-default-features --features serde #533

Description

@tnull

When neither std nor no-std are present but serde is selected, the build breaks with a lot of error along the lines:

> cargo build --no-default-features --features serde
   Compiling miniscript v9.0.0 (/Users/ero/workspace/rust-miniscript)
error[E0658]: use of unstable library feature 'rustc_private': this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via `Cargo.toml` instead?
   --> src/lib.rs:100:1
    |
100 | extern crate hashbrown;
    | ^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: see issue #27812 <https://github.com/rust-lang/rust/issues/27812> for more information

error[E0658]: use of unstable library feature 'rustc_private': this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via `Cargo.toml` instead?
  --> src/descriptor/mod.rs:61:19
   |
61 | pub type KeyMap = HashMap<DescriptorPublicKey, DescriptorSecretKey>;
   |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: see issue #27812 <https://github.com/rust-lang/rust/issues/27812> for more information

...

This could be solved by either making the serde feature set std and offering an equivalent serde-nostd feature, or, by at least sufficiently documenting that choosing either is required and doing otherwise might lead to unexpected behavior. Happy to open a PR to address this in one way or the other.

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