Skip to content
New issue

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

Wrong message in a cyclic dependency scenario #7538

Closed
c410-f3r opened this issue Oct 24, 2019 · 2 comments
Closed

Wrong message in a cyclic dependency scenario #7538

c410-f3r opened this issue Oct 24, 2019 · 2 comments
Labels
C-bug Category: bug

Comments

@c410-f3r
Copy link

c410-f3r commented Oct 24, 2019

Scenario

Project A has a Foo trait and project B has a Bar trait. Foo has the Bar bound associated with it (Foo: Bar), therefore, project A depends on project B ([dependencies] b = { path = "../b" }). Now, project B depends on project A as a development dependency ([dev-dependencies] a = { path = "../a" }) and the following code:

#[cfg(test)]
mod tests {
    struct Something;
    impl crate::Bar for Something {}
    impl a::Foo for Something {}
}

Triggers an erroneous message of this cyclic dependency: the trait 'a::Foo' is not implemented for 'tests::Something'.
Not sure if cyclic dependencies are allowed with development crates but the showed message in this case is obviously wrong.

Notes

Output of cargo version: cargo 1.40.0-nightly (a429e8c 2019-10-04)

@c410-f3r c410-f3r added the C-bug Category: bug label Oct 24, 2019
@c410-f3r c410-f3r changed the title Wrong message in a cylic dependency scenario Wrong message in a cyclic dependency scenario Oct 24, 2019
@ehuss
Copy link
Contributor

ehuss commented Oct 24, 2019

Thanks for the report. I think this is essentially the same as #6765, so I'm going to close in favor of that.

@ehuss ehuss closed this as completed Oct 24, 2019
@c410-f3r
Copy link
Author

Thanks. They are indeed the same

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

2 participants