-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #14089 - Eh2406:check_cycles, r=weihanglo
Simplify checking for dependency cycles ### What does this PR try to resolve? In my PubGrub work I had to try to understand the `check_cycles` post resolution pass. I found the code tricky to understand and doing some unnecessary reallocations. I cleaned up the code to remove the unnecessary data structures so that I could better understand. ### How should we test and review this PR? It's an internal re-factor, and the tests still pass. But this code is not extensively tested by our test suite. In addition I ran my "resolve every crate on crates.io" script against a local check out of this branch. With the old code as `check_cycles_old` and the PR code as `check_cycles_new` the following assertion did not hit: ```rust fn check_cycles(resolve: &Resolve) -> CargoResult<()> { let old = check_cycles_old(resolve); let new = check_cycles_new(resolve); assert_eq!(old.is_err(), new.is_err()); old } ``` That experiment also demonstrated that this was not a significant performance change in either direction. ### Additional information If you're having questions about this code while you're reviewing, this would be a perfect opportunity for better naming and comments. Please ask questions.
- Loading branch information
Showing
3 changed files
with
47 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters