Skip to content

error[E0152]: duplicate lang item in crate std (which indexmap depends on): panic_impl. #258

@tdelabro

Description

@tdelabro

Hey,

I'm trying to use indexmap in a substrate pallet, which is a no_std environment.

If I import: indexmap = { version = "1.9.2", default-features = false }
I get the following error:

 error[E0152]: duplicate lang item in crate `std` (which `indexmap` depends on): `panic_impl`.
    |
    = note: the lang item is first defined in crate `sp_io` (which `frame_support` depends on)
    = note: first definition in `sp_io` loaded from /Users/tdelabro/Documents/code/starkware/kaioshin/target/debug/wbuild/kaioshin-runtime/target/wasm32-unknown-unknown/release/deps/libsp_io-c4656f0a7cd2540b.rmeta
    = note: second definition in `std` loaded from /Users/tdelabro/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/wasm32-unknown-unknown/lib/libstd-d66a635e2d91bd07.rlib

  For more information about this error, try `rustc --explain E0152`.
  warning: `pallet-cairo-execution-engine` (lib) generated 1 warning
  error: could not compile `pallet-cairo-execution-engine` (lib) due to previous error; 1 warning emitted

Which usually indicate that some crate uses an std feature.

This import the following version:

[[package]]
name = "indexmap"
version = "1.9.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399"
dependencies = [
"autocfg",
"hashbrown 0.12.3",
"serde",
]

I can't find this commit on your repo so I have tried other versions of the crate: 4d410509d2e67c3d33e17c6d4cdbf622ea8458f8 and 4d52cf338c6ff9f742aac716f41b8a5497842f92, which are the two last commits on your indexmap-1.x release branch, both raise the same problem.

The strange thing is that any commit on the branch master, including ca5f848e10c31e80aeaad0720d14aa2f6dd6cfb1 which is the commit of the release 1.9.2 are valid and does not raise any errors.

My conclusion is that there is something wicked with your indexmap-1.x release branch.

A temporary fix is to use the master branch rather that the crate.io releases.

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