Fix infinite recursion in CargoError impl for Box<CargoError>

Insert necessary explicit derefs.
auto merge of #645 : bkoropoff/cargo/fix-infinite-recursion, r=alexcrichton

Insert necessary explicit derefs.
Use the new Entry API for HashMaps
auto merge of #647 : dotdash/cargo/entry, r=alexcrichton
Allow selectively cleaning packages

This adds a new argument to `cargo clean` which will enable selectively cleaning
particular packages. The command only cleans the package specified, no other
(not the dependencies of the package).

cc #537
Allow specifying what to build as part of `cargo build`

This allows selectively building one dependency within a dependency graph for
debugging its build or such.

Closes #537
Add cargo {test,bench} -p <spec>

This functionality allows running tests and benchmarks on any upstream
dependencies in the dependency graph. This is most useful for path sources all
developed in tandem (see Servo for instance).

In terms of built artifacts, this will actually preserve as many artifacts as
possible. That means that if you test a low-level dependency with the high-level
artifacts already built, the high-level artifacts will not get removed. This
means that it's possible to accidentally have a low-level dependency to depend
on a higher level one just because it's lib is picked up via -L, but this is
generally a necessary evil to get testing to not rebuild packages too often.

Closes #483
Deprecate `cargo update foo`

To maintain consistency with `cargo {build,test,bench,clean}` the `update`
subcommand now takes a specific package via the `-p` argument instead of as a
positional argument.
Improve the error message for ambiguous specs
auto merge of #628 : alexcrichton/cargo/issue-537, r=brson

This is rebased on https://github.com/rust-lang/cargo/pull/617 as I wanted to use one of the functions added in the patch. Otherwise the details are in the commits.
Refine dependencies on dev-deps

Currently whenever a dev-dep is brought in to the build process the entire
library is rebuilt, but this is just unnecessary recompilation because the
library *can't* depend on the dev-dep.

This commit refines the dependency graph so the lib stage only depends on
transitive dependencies (non-dev-deps), and a new stage for tests was added
which depends on the packages libraries *and* the dev-deps. This way only the
test are rebuilt when dev-deps change, not libraries.
Allow "cycles" through dev-deps

Development dependencies can never be the root of a cycle because nothing
depends on a development dependency, so there's no need to track the start of a
cycle at the edge going out to a development dependency.

If a cycle is later detected, it will still be reported.
Fix the dependency graph with root pkg cycles

If the root package ended up depending on itself through some development
dependency (technically not a cycle), then the resolve phase would currently
overwrite some previous result, destroying the progress. By registering the root
package as seen early on this prevents the overwriting from happening and
instead appending happens.
Fix dependencies linking to the local package

This is a legitimate possibility which doesn't necessarily imply a cycle, so the
case needs to be handled.
Add a test for #432

All problems have been fixed in the previous commits, and this now closes #432