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

Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
Add range lint for float literals, fixing #10934
typeck: check casts from pointers to floats, closes #15445
std: Add some implementation of common traits

- semver::Version is now Eq, Ord, and Hash
- Path is now PartialOrd and Ord
mk: Don't run rustc manually during distcheck

This is already checked by the install script, no need to check it twice.
auto merge of #15578 : alexcrichton/rust/fix-dist-again, r=pnkfelix

This is already checked by the install script, no need to check it twice.
auto merge of #14519 : hirschenberger/rust/issue-10934, r=alexcrichton

Issue #10934
auto merge of #15559 : fhahn/rust/issue-15445-mut-cast, r=alexcrichton

I've added an error message for casts from raw pointers to floats #15445.
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
Deprecate `str::from_utf8_owned`

Use `String::from_utf8` instead

[breaking-change]
Deprecate `str::from_chars`

Use `String::from_chars` instead

[breaking-change]
Deprecate `str::from_char`

Use `String::from_char` or `.to_str` instead

[breaking-change]
Deprecate str::from_byte

Replaced by `String::from_byte`

[breaking-change]
Deprecate `str::from_utf16`

Use `String::from_utf16` instead

[breaking-change]
Deprecate `str::from_utf16_lossy`

Use `String::from_utf16_lossy` instead.

[breaking-change]