We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cyclic dependencies through dev-dependencies can lead to a confusing error message
Here is a minimal repro: https://github.com/mikhailOK/bad-cargo-cyclic-dependency
Two crates, crate1 and crate2 crate2 depends on crate1, but crate1 has crate2 in [dev-dependencies]
crate1/src/lib.rs:
#[derive(PartialEq, Eq, Debug)] pub struct Value {} pub struct ValueReturner {} impl ValueReturner { pub fn return_value(&self) -> Value { Value {} } } #[cfg(test)] mod tests { pub fn mismatched_types() { let returner = crate2::get_returner(); assert_eq!(returner.return_value(), crate::Value {}); } }
crate2/src/lib.rs:
use crate1::ValueReturner; pub fn get_returner() -> ValueReturner { ValueReturner {} }
cargo test -p crate1 fails with a compilation error:
error[E0308]: mismatched types --> crate1/src/lib.rs:16:9 | 16 | assert_eq!(returner.return_value(), crate::Value {}); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `crate1::Value`, found struct `Value` | = note: expected type `crate1::Value` found type `Value`
Comipler version: rustc 1.35.0-nightly (e68bf8ae1 2019-03-11)
rustc 1.35.0-nightly (e68bf8ae1 2019-03-11)
My question is, is there a valid use case for this kind of cyclic dependencies?
The text was updated successfully, but these errors were encountered:
I have the same issue, and asking some help here.
Sorry, something went wrong.
No branches or pull requests
Cyclic dependencies through dev-dependencies can lead to a confusing error message
Here is a minimal repro: https://github.com/mikhailOK/bad-cargo-cyclic-dependency
Two crates, crate1 and crate2
crate2 depends on crate1, but crate1 has crate2 in [dev-dependencies]
crate1/src/lib.rs:
crate2/src/lib.rs:
cargo test -p crate1 fails with a compilation error:
Comipler version:
rustc 1.35.0-nightly (e68bf8ae1 2019-03-11)
My question is, is there a valid use case for this kind of cyclic dependencies?
The text was updated successfully, but these errors were encountered: