I want to use several MD5 implementations in the same Rust program.
Two of them both want to be named "md5", which is causing an error from the compiler:
error[E0465]: multiple rlib candidates for `md5` found
--> md5s/src/lib.rs:10:1
|
10 | extern crate md5;
| ^^^^^^^^^^^^^^^^^
|
note: candidate #1: /home/dstromberg/src/home-svn/md5s/trunk/target/debug/deps/libmd5-256ebb56f51dbbc0.rlib
--> md5s/src/lib.rs:10:1
|
10 | extern crate md5;
| ^^^^^^^^^^^^^^^^^
note: candidate #2: /home/dstromberg/src/home-svn/md5s/trunk/target/debug/deps/libmd5-56cccd41ff35cdb0.rlib
--> md5s/src/lib.rs:10:1
|
10 | extern crate md5;
| ^^^^^^^^^^^^^^^^^
error[E0463]: can't find crate for `md5`
--> md5s/src/lib.rs:10:1
|
10 | extern crate md5;
| ^^^^^^^^^^^^^^^^^ can't find crate
Is there a way of renaming one or both of them without subverting cargo?
The specific crates are:
I have 2 Cargo.toml's:
$ grep -n . $(find . -name Cargo.toml -print)
below cmd output started 2018 Wed Nov 14 06:03:48 PM PST
./md5s/Cargo.toml:1:[package]
./md5s/Cargo.toml:2:name = "md5s"
./md5s/Cargo.toml:3:version = "0.1.0"
./md5s/Cargo.toml:4:authors = ["xxxxxxxx@gmail.com"]
./md5s/Cargo.toml:6:[dependencies]
./md5s/Cargo.toml:7:rust-crypto = "^0.2"
./md5s/Cargo.toml:8:md5 = "^0.5"
./md5s/Cargo.toml:9:# md-5 = "^0.8.0"
./Cargo.toml:1:# Cargo structure based on https://stackoverflow.com/questions/26946646/rust-package-with-both-a-library-and-a-binary
./Cargo.toml:2:[package]
./Cargo.toml:3:name = "compare-md5s"
./Cargo.toml:4:version = "0.1.0"
./Cargo.toml:5:authors = ["Dan Stromberg <xxxxxxxx@gmail.com>"]
./Cargo.toml:7:[workspace]
./Cargo.toml:9:[dependencies]
./Cargo.toml:10:md5s = { path = "md5s" }
./Cargo.toml:11:rust-crypto = "^0.2"
./Cargo.toml:12:md5 = "^0.5"
./Cargo.toml:13:# md-5 = "^0.8.0"
The project builds if I leave the 2 md-5's commented out, and fails with the error above if I uncomment them.
In md5s/src/lib.rs, I have:
extern crate md5;