Make a test more resilient against the host system

If the host system had $HOME/.cargo/config which configured a user name/email
then this test would fail because those would be prioritized over $USER.

Closes #514
Fix typos in `cargo build -h`
Update dependencies
Add --open flag to cargo doc
auto merge of #655 : ebfe/cargo/deps, r=alexcrichton

At least rust-encoding needs updating to compile with rust master.
auto merge of #631 : alexcrichton/cargo/issue-514, r=brson

If the host system had $HOME/.cargo/config which configured a user name/email
then this test would fail because those would be prioritized over $USER.

Closes #514
auto merge of #652 : tomaka/cargo/open-docs, r=alexcrichton

Opens the generated docs in a browser.

Since it's more a utility feature, I didn't write this in a robust way. There's no error if it fails to open a browser.
Install materials to comply with upstream licenses

This follows #656 by mentioning OpenSSL in the README, as well as install all
license files on installation. A hand-generated LICENSE-THIRD-PARTY is also
included.

Closes #656

This also approaches #657 by mentioning that we have GPL software in the README.
Cargo will hopefully support a more complete "all source" distribution in the
future, but at this time there is not an easy way to generate a complete source
tarball via cargo.
auto merge of #654 : ebfe/cargo/cargo-build-help, r=alexcrichton
auto merge of #659 : alexcrichton/cargo/licenseing, r=brson

This follows #656 by mentioning OpenSSL in the README, as well as install all
license files on installation. A hand-generated LICENSE-THIRD-PARTY is also
included.

Closes #656

This also approaches #657 by mentioning that we have GPL software in the README.
Cargo will hopefully support a more complete "all source" distribution in the
future, but at this time there is not an easy way to generate a complete source
tarball via cargo.
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
auto merge of #630 : alexcrichton/cargo/issue-432, r=brson

This is a series of commits which culminates in fixing #432, fixing a number of other related issues along the way. The biggest user-facing fix here is that if you run `cargo build` followed by `cargo test` your library will no longer be rebuilt if you have dev-dependencies.
Parse escaped spaces in makefile dependencies

This means that if a project has a file with a space in the name it will
properly have its freshness calculated as opposed to always having it as a
candidate to be rebuilt.

Closes #648
Let the help command work consistently everywhere

This adds a dummy help command so that it's usage can be documented with docopt!

Also adds help flags to all of the subcommands that were missing them. Without
that `cargo help sub-command` shows Invalid Argument before the usage text.
Remote `unused` lint

It's causing tons of not-very-helpful errors that are breaking the build.
auto merge of #670 : bkoropoff/cargo/unused-everywhere, r=alexcrichton

I'm not sure what changed, but unused value lints were popping up everwhere when I tried to build today.

This turns on the `if let` feature since it allows rewriting a lot of calls to `Option::map` that were only being used for their side effects into a clean form.  Cargo seems as good of a place as any to dogfood it.