Auto merge of #4683 - djc:requirements, r=alexcrichton
authorbors <bors@rust-lang.org>
Tue, 31 Oct 2017 16:49:55 +0000 (16:49 +0000)
committerbors <bors@rust-lang.org>
Tue, 31 Oct 2017 16:49:55 +0000 (16:49 +0000)
Introduce Requirements struct to clarify code

`cargo::core::resolver::build_requirements()` previously, in this order:

* Defined local variables to track state
* Called a function to mutate the local variables
* Defined the aforementioned function
* Returned two out of three local variables as a tuple

This PR changes the code so that this is a recast as a struct (appropriately called `Requirements`), which is mutated in a more fine-grained way by its methods and acts as the return type for `build_requirements()`. To me, this seems a lot easier to understand.

This work was done in the context of #1286, but I figured it was easier to start landing some of the refactoring to avoid bitrot and get early (well, earlier) feedback.


Trivial merge