You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Aside from the root (binary) crate, there are two library crates (foo and bar). The root crate specifies both library crates as dependencies in it's Cargo.toml. Neither of the libraries specify any dependencies in their Cargo.tomls. However, foo attempts to pull in bar anyway with an extern crate bar.
When you run cargo run, this fails, exactly as you'd expect:
$ cargo run
Compiling foo v0.0.1 (file:///C:/cygwin64/home/Cifram/cargobug)
Compiling bar v0.0.1 (file:///C:/cygwin64/home/Cifram/cargobug)
lib.rs:1:1: 1:18 error: can't find crate for `bar`
lib.rs:1 extern crate bar;
^~~~~~~~~~~~~~~~~
error: aborting due to previous error
Build failed, waiting for other jobs to finish...
Could not compile `foo`.
But if you immediately run cargo run again, it succeeds:
Even though nothing has been done to address the failure.
Presumably it's finding the copy of bar that was compiled in the first pass, even though bar is still not in it's Cargo.toml. This is likely because rustc is run with a -L for the target/deps directory, where the compiled libraries are stored.
The text was updated successfully, but these errors were encountered:
I've setup a minimal repro case here: https://github.com/Cifram/cargobug
Aside from the root (binary) crate, there are two library crates (
foo
andbar
). The root crate specifies both library crates as dependencies in it's Cargo.toml. Neither of the libraries specify any dependencies in their Cargo.tomls. However,foo
attempts to pull inbar
anyway with anextern crate bar
.When you run
cargo run
, this fails, exactly as you'd expect:But if you immediately run
cargo run
again, it succeeds:Even though nothing has been done to address the failure.
Presumably it's finding the copy of
bar
that was compiled in the first pass, even thoughbar
is still not in it's Cargo.toml. This is likely because rustc is run with a -L for thetarget/deps
directory, where the compiled libraries are stored.The text was updated successfully, but these errors were encountered: