error[E0152]: found duplicate lang item `panic_impl`
--> src/lib.rs:49:5
|
49 | pub unsafe fn on_panic(_info: &::core::panic::PanicInfo) -> ! {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: the lang item is first defined in crate `std` (which `libsecp256k1` depends on)
= note: first definition in `std` loaded from /home/birchmd/.rustup/toolchains/nightly-2021-03-25-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libstd-c154c491353fefeb.rlib
= note: second definition in the local crate (`aurora_engine`)
error[E0152]: found duplicate lang item `oom`
--> src/lib.rs:56:5
|
56 | pub unsafe fn on_alloc_error(_: core::alloc::Layout) -> ! {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: the lang item is first defined in crate `std` (which `libsecp256k1` depends on)
= note: first definition in `std` loaded from /home/birchmd/.rustup/toolchains/nightly-2021-03-25-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libstd-c154c491353fefeb.rlib
= note: second definition in the local crate (`aurora_engine`)
error: aborting due to 2 previous errors
Note the error says that libsecp256k1 depends on std even though default-features = false.
I think that https://github.com/paritytech/libsecp256k1/commit/3aa638bdee7fff9c11ce5f22d8cd19fa163861ac made a change which causes
std
to be pulled in even ifdefault-features = false
.To reproduce:
First, create a no-std project with
#[panic_handler]
and#[alloc_error_handler]
functions. Include as a dependencyand make use of it. This compiles fine.
Now try with the dependency using the next commit:
and compile again. The following errors appear
Note the error says that
libsecp256k1
depends onstd
even thoughdefault-features = false
.