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>
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.
Match binding is assignment

In its first pass, namely gather_loans, the borrow checker tracks the
initialization sites among other things it does. It does so for let
bindings with initializers but not for bindings in match arms, which are
effectively also assignments. This patch does that for borrow checker.

Closes #12452.
Run the travis build as one large command

It appears that travis doesn't stop running script commands after the first one
fails (see https://github.com/travis-ci/travis-ci/issues/1066), so chain all our
commands together with && for now.
Update source code layout in src/

with the new modules that moved from extra,
and with other undocumented folders.
also add a note about potential changes.
Tutorial: Add std::num::sqrt to the example.

We should be using the package std::num::sqrt instead of the sqrt function that was defined to return 0.0
test: single-variant enum can't be dereferenced

Closes #9814
Test fixes from rollup