Auto merge of #4806 - alexcrichton:fix-infinite-loop, r=matklad
authorbors <bors@rust-lang.org>
Tue, 12 Dec 2017 05:41:53 +0000 (05:41 +0000)
committerbors <bors@rust-lang.org>
Tue, 12 Dec 2017 05:41:53 +0000 (05:41 +0000)
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


Trivial merge