mirror of
https://github.com/rust-lang/cargo.git
synced 2025-09-28 11:20:36 +00:00

First reported in rust-lang/rust#65014 it looks like our error message on cyclic dependencies may be confusing at times. It looks like this is an issue because there are multiple paths through a graph for a dependency, so using the generic `path_to_top` function isn't producing the most useful path for this purpose. We're already walking the graph though, so this commit adds an extra parameter which collects the list of packages we've visited so far to produce a hopefully always-accurate error message showing the chain of dependencies end-to-end for what depends on what.