mk: Get "make check" passing with --disable-rpath

This involves passing through LD_LIBRARY_PATH through more places, specifically
in the compiletest, run-make, and doctest runners.
Gate default type parameter overrides.
Fixes #12423.
Exclude build metadata from equality checking.

Build metadata is already excluded from precedence checking in line with
the spec. For consistency and providing strict total ordering for
Version, build metadata should also be ignored in Eq impl.

Closes #12438

Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
std: minor whitespace cleanup
replace manual Hash impls with `#[deriving(Hash)]`
test: Use `#[deriving(Hash)]` in a couple tests
rustc: rename `hash` to the proper name `state`
auto merge of #12454 : omasanori/rust/semver-eq, r=alexcrichton

Closes #12438
rustc: Don't error on the rlib symlinks

This commit implements a layman's version of realpath() for metadata::loader to
use in order to not error on symlinks pointing to the same file.

Closes #12459
Use lines_any() when parsing output form "ar"

On windows lines are delimited with \r\n while on unix they're delimited with
\n.

cc #12471
Remove some obsolete ignored tests

* compile-fail/vec-add.rs is obsolete, there are no mutable
  vectors any more, #2711 is closed
* compile-fail/issue-1451.rs is obsolete, there are no more
  structural records, #1451 is closed
* compile-fail/issue-2074.rs is obsolete, an up to date test
  is in run-pass/nested-enum-same-names.rs, #2074 is closed
* compile-fail/omitted-arg-wrong-types.rs is obsolete, #2093
  is closed
std: make .swap_remove return Option<T>.

This is one of the last raw "indexing" method on vectors that returns
`T` instead of the Option.
std: Add Vec.reserve for rounding-up reservation.

`.reserve_exact` can cause pathological O(n^2) behaviour, so providing a
`.reserve` that ensures that capacity doubles (if you step 1, 2, ..., n)
is more efficient.

cc #11949
Remove std::default::Default from the prelude
Remove std::from_str::FromStr from the prelude
Remove std::num::ToStrRadix from the prelude
syntax: record multibyte chars' positions absolutely, not relative to
file.

Previously multibyte UTF-8 chars were being recorded as byte offsets
from the start of the file, and then later compared against global byte
positions, resulting in the compiler possibly thinking it had a byte
position pointing inside a multibyte character, if there were multibyte
characters in any non-crate files. (Although, sometimes the byte offsets
line up just right to not ICE, but that was a coincidence.)

Fixes #11136.
Fixes #11178.
syntax: calculate positions of multibyte characters more correctly.

They are still are not completely correct, since it does not handle
graphemes at all, just codepoints, but at least it handles the common
case correctly.

The calculation was previously very wrong (rather than just a little bit
wrong): it wasn't accounting for the fact that every character is 1
byte, and so multibyte characters were pretending to be zero width.

cc #8706
Mark by-value parameters that are passed on the stack as nocapture

The by-value argument is a copy that is only valid for the duration of
the function call, therefore keeping any pointer to it that outlives the
call is illegal.
syntax: allow stmt/expr macro invocations to be delimited by {}.

This makes using control-flow-y macros like `spawn! { ... }` more fluent
and natural.

cc #11892.