-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Closed
Labels
Description
Problem
Adding a renamed dev-dependency with path = "."
doesn't result in the correct name being used during compilation. The dependency is added, but it uses the original package name in the --extern
.
Steps
> git clone https://gist.github.com/Nemo157/105a7f43e0920d6ab9572e88871c18ee foo && cd foo
> cargo test -vv --lib
.... rustc ... --extern foo=/home/nemo157/.cargo/shared-target/debug/deps/libfoo-c6907ef92fad7161.rlib ...
error[E0433]: failed to resolve: use of undeclared crate or module `bar`
--> lib.rs:8:13
|
8 | fn test() { bar::foo() }
| ^^^ use of undeclared crate or module `bar`
> cargo test -vv --test test
.... rustc ... --extern foo=/home/nemo157/.cargo/shared-target/debug/deps/libfoo-c6907ef92fad7161.rlib --extern foo=/home/nemo157/.cargo/shared-target/debug/deps/libfoo-c6907ef92fad7161.rlib ...
error[E0433]: failed to resolve: use of undeclared crate or module `bar`
--> test.rs:2:17
|
2 | pub fn test() { bar::foo(); }
| ^^^ use of undeclared crate or module `bar`
> cargo test -vv --doc
.... rustdoc ... --extern foo=/home/nemo157/.cargo/shared-target/debug/deps/libfoo-c6907ef92fad7161.rlib --extern foo=/home/nemo157/.cargo/shared-target/debug/deps/libfoo-c6907ef92fad7161.rlib ...
error[E0433]: failed to resolve: use of undeclared crate or module `bar`
--> lib.rs:2:1
|
4 | bar::foo();
| ^^^ use of undeclared crate or module `bar`
Possible Solution(s)
Apply the requested rename of the dependency.
Notes
Output of cargo version
: cargo 1.53.0-nightly (0ed318d18 2021-04-23)