Fix an infinite loop in error reporting
authorAlex Crichton <alex@alexcrichton.com>
Sun, 10 Dec 2017 18:14:23 +0000 (10:14 -0800)
committerAlex Crichton <alex@alexcrichton.com>
Sun, 10 Dec 2017 18:14:23 +0000 (10:14 -0800)
commit4f0b8f88085572f4f888fb49780ff0a76ce42ac4
tree0308fdbc328864724b49a7864dc4266d6060b1a4
parent3992e5259ba99385016e27a7971121e916d01d5a
Fix an infinite loop in error reporting

The `path_to_root` function unfortunately didn't account for cycles in the
dependency graph introduced through dev-dependencies, so if a cycle was present
then the function would infinitely loop pushing items onto a vector.

This commit fixes the infinite loop and also touches up the reporting to be a
little more consistent with the rest of Cargo
src/cargo/core/resolver/mod.rs
src/cargo/ops/cargo_rustc/links.rs
tests/build-script.rs