Use std::fmt::radix instead of to_str_radix.

Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
Mistake in AtomicBool spinlock example

The current example of a spinlock was not correct. The lock is actually acquired
when old == result. So we only need to deschedule when this is not the case.
Remove deprecated std::unstable module.

Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
std: Add some implementation of common traits

- semver::Version is now Eq, Ord, and Hash
- Path is now PartialOrd and Ord
Document event_loop_factory usage

Add a couple of lines mentioning event_loop_factory - no clear error message is
given if you attempt to perform I/O in tasks created in this fashion.
More robust install.sh: do runnability test in fresh subdirectory.

Fix #15558.
io::process::Command: add fine-grained env builder

This commit changes the `io::process::Command` API to provide
fine-grained control over the environment:

* The `env` method now inserts/updates a key/value pair.
* The `env_remove` method removes a key from the environment.
* The old `env` method, which sets the entire environment in one shot,
  is renamed to `env_set_all`. It can be used in conjunction with the
  finer-grained methods. This renaming is a breaking change.

To support these new methods, the internal `env` representation for
`Command` has been changed to an optional `HashMap` holding owned
`CString`s (to support non-utf8 data). The `HashMap` is only
materialized if the environment is updated. The implementation does not
try hard to avoid allocation, since the cost of launching a process will
dwarf any allocation cost.

This patch also adds `PartialOrd`, `Eq`, and `Hash` implementations for
`CString`.

[breaking-change]
auto merge of #15353 : aturon/rust/env-hashmap, r=alexcrichton

This commit adds `env_insert` and `env_remove` methods to the `Command`
builder, easing updates to the environment variables for the child
process. The existing method, `env`, is still available for overriding
the entire environment in one shot (after which the `env_insert` and
`env_remove` methods can be used to make further adjustments).

To support these new methods, the internal `env` representation for
`Command` has been changed to an optional `HashMap` holding owned
`CString`s (to support non-utf8 data). The `HashMap` is only
materialized if the environment is updated. The implementation does not
try hard to avoid allocation, since the cost of launching a process will
dwarf any allocation cost.

This patch also adds `PartialOrd`, `Eq`, and `Hash` implementations for
`CString`.
Add scaffolding for assigning alpha-numeric codes to rustc diagnostics
auto merge of #15336 : jakub-/rust/diagnostics, r=brson

This is a continuation of @brson's work from https://github.com/rust-lang/rust/pull/12144.

This implements the minimal scaffolding that allows mapping diagnostic messages to alpha-numeric codes, which could improve the searchability of errors. In addition, there's a new compiler option, `--explain {code}` which takes an error code and prints out a somewhat detailed explanation of the error. Example:

```rust
fn f(x: Option<bool>) {
	match x {
		Some(true) | Some(false) => (),
		None => (),
		Some(true) => ()
	}
}
```

```shell
[~/rust]$ ./build/x86_64-apple-darwin/stage2/bin/rustc ./diagnostics.rs --crate-type dylib
diagnostics.rs:5:3: 5:13 error: unreachable pattern [E0001] (pass `--explain E0001` to see a detailed explanation)
diagnostics.rs:5 		Some(true) => ()
                 		^~~~~~~~~~
error: aborting due to previous error
[~/rust]$ ./build/x86_64-apple-darwin/stage2/bin/rustc --explain E0001

    This error suggests that the expression arm corresponding to the noted pattern
    will never be reached as for all possible values of the expression being matched,
    one of the preceeding patterns will match.

    This means that perhaps some of the preceeding patterns are too general, this
    one is too specific or the ordering is incorrect.

```

I've refrained from migrating many errors to actually use the new macros as it can be done in an incremental fashion but if we're happy with the approach, it'd be good to do all of them sooner rather than later.

Originally, I was going to make libdiagnostics a separate crate but that's posing some interesting challenges with semi-circular dependencies. In particular, librustc would have a plugin-phase dependency on libdiagnostics, which itself depends on librustc. Per my conversation with @alexcrichton, it seems like the snapshotting process would also have to change. So for now the relevant modules from libdiagnostics are included using `#[path = ...] mod`.
auto merge of #15564 : alexcrichton/rust/moar-hash, r=huonw

- semver::Version is now Eq, Ord, and Hash
- Path is now PartialOrd and Ord
auto merge of #15570 : omasanori/rust/radix, r=alexcrichton
auto merge of #15574 : omasanori/rust/hidden, r=huonw
auto merge of #15575 : mvdnes/rust/spinlock_error, r=alexcrichton

The current example of a spinlock was not correct. The lock is actually acquired
when `old == result`. So we only need to deschedule when this is not the case.
auto merge of #15576 : mrmonday/rust/patch-1, r=alexcrichton

Add a couple of lines mentioning event_loop_factory - no clear error message is given if you attempt to perform I/O in tasks created in this fashion. I spent a many hours debugging this yesterday which would have been avoided if it were documented.
auto merge of #15580 : pnkfelix/rust/fsk-fix-15558, r=alexcrichton

Fix #15558.