Out of curiosity, I'm running $ rust-analyzer analysis-stats . in my substrate repo root directory.

I'm getting reports about ~30 cyclic dependencies, similar to

[ERROR project_model::workspace] cyclic deps: frame_election_provider_support(CrateId(199)) -> frame_election_provider_solution_type(CrateId(198)), alternative path: frame_election_provider_solution_type(CrateId(198)) -> frame_election_provider_support(CrateId(199))

I'm wondering if this is a problem or not? Should it be fixed or should I configure rust-analyzer to ignore it somehow?

I'm running this version: rust-analyzer 1.64.0-nightly (897a7ec 2022-07-17)

  • I think it may be related to this issue related to build.rs (there is a dup issue calling out cyclic deps). This was just "fixed" upstream in RA, so it should land in a release 🔜 and make it's way into the VSCode extension 🤞
    – Nuke
    Commented Sep 22, 2022 at 19:17

1 Answer 1


Cyclic dependencies are not allowed by Rust in general.

I looked into the specific error that is being brought up here.

Package frame-election-provider-support has a dependency on frame-election-provider-solution-type.

But package frame-election-provider-solution-type only has a dev-dependency to frame-election-provider-support.

In this case, the cyclic dependency is right, and something that is explicitly allowed by the rust testing framework.

So in this case, no, nothing needs to be fixed afaik.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.