Avoid building as root with `sudo make install`

When running `sudo make install`, we only want to run the actual install
as root, the building of the documentation and the distribution folder
should happen as the non-root user.

Related to #13728.
Add help diagnostic messages

This adds ‘help’ diagnostic messages to rustc. This is used for anything that
provides help to the user, particularly the `--explain` messages that were
previously integrated into the relevant error message.
bench: Improve the spectralnorm shootout benchmark

This improves the spectralnorm shootout benchmark through a few vectors after
looking at the leading C implementation:

* The simd-based f64x2 is now used to parallelize a few computations
* RWLock usage has been removed. A custom `parallel` function was added as a
  form of stack-based fork-join parallelism. I found that the contention on the
  locks was high as well as hindering other optimizations.

This does, however, introduce one `unsafe` block into the benchmarks, which
previously had none.

In terms of timings, the before and after numbers are:

```
$ time ./shootout-spectralnorm-before
./shootout-spectralnorm-before  2.07s user 0.71s system 324% cpu 0.857 total
$ time ./shootout-spectralnorm-before 5500
./shootout-spectralnorm-before 5500  11.88s user 1.13s system 459% cpu 2.830 total
$ time ./shootout-spectralnorm-after
./shootout-spectralnorm-after  0.58s user 0.01s system 280% cpu 0.210 tota
$ time ./shootout-spectralnorm-after 5500
./shootout-spectralnorm-after 5500  3.55s user 0.01s system 455% cpu 0.783 total
```
improve shootout-reverse-complement.rs using unsafe code
Fix the description of raw byte string literals
impl Buffer for ChanReader
shootout-reverse-complement: reimplement TwoSideIter using pointers
Removes useless confs from bitv.rs

Linked to #18009
don't refer to the nonexistant gc
auto merge of #17989 : alexcrichton/rust/spectralnorm, r=thestinger

This improves the spectralnorm shootout benchmark through a few vectors after
looking at the leading C implementation:

* The simd-based f64x2 is now used to parallelize a few computations
* RWLock usage has been removed. A custom `parallel` function was added as a
  form of stack-based fork-join parallelism. I found that the contention on the
  locks was high as well as hindering other optimizations.

This does, however, introduce one `unsafe` block into the benchmarks, which
previously had none.

In terms of timings, the before and after numbers are:

```
$ time ./shootout-spectralnorm-before
./shootout-spectralnorm-before  2.07s user 0.71s system 324% cpu 0.857 total
$ time ./shootout-spectralnorm-before 5500
./shootout-spectralnorm-before 5500  11.88s user 1.13s system 459% cpu 2.830 total
$ time ./shootout-spectralnorm-after
./shootout-spectralnorm-after  0.58s user 0.01s system 280% cpu 0.210 tota
$ time ./shootout-spectralnorm-after 5500
./shootout-spectralnorm-after 5500  3.55s user 0.01s system 455% cpu 0.783 total
```
auto merge of #17998 : rapha/rust/master, r=alexcrichton
Fix soundness bug in treatment of closure upvars by regionck

- Unify the representations of `cat_upvar` and `cat_copied_upvar`
- In `link_reborrowed_region`, account for the ability of upvars to
  change their mutability due to later processing.  A map of recursive
  region links we may want to establish in the future is maintained,
  with the links being established when the kind of the borrow is
  adjusted.
- When categorizing upvars, add an explicit deref that represents the
  closure environment pointer for closures that do not take the
  environment by value.  The region for the implicit pointer is an
  anonymous free region type introduced for this purpose.  This
  creates the necessary constraint to prevent unsound reborrows from
  the environment.
- Add a note to categorizations to make it easier to tell when extra
  dereferences have been inserted by an upvar without having to
  perform deep pattern matching.
- Adjust borrowck to deal with the changes.  Where `cat_upvar` and
  `cat_copied_upvar` were previously treated differently, they are
  now both treated roughly like local variables within the closure
  body, as the explicit derefs now ensure proper behavior.  However,
  error diagnostics had to be changed to explicitly look through the
  extra dereferences to avoid producing confusing messages about
  references not present in the source code.

Closes issue #17403.  Remaining work:

- The error diagnostics that result from failed region inference are
  pretty inscrutible and should be improved.

Code like the following is now rejected:

    let mut x = 0u;
    let f = || &mut x;
    let y = f();
    let z = f(); // multiple mutable references to the same location

This also breaks code that uses a similar construction even if it does
not go on to violate aliasability semantics.  Such code will need to
be reworked in some way, such as by using a capture-by-value closure
type.

[breaking-change]
Update test for issue 17780 since diagnostic message have changed

The test was also renamed to be more descriptive.
Add regression test for issue #17403
Add failure tests for moving out of unboxed closure environments
auto merge of #17869 : bkoropoff/rust/bound-all-the-upvars, r=nikomatsakis

This PR is based on #17784, which fixes closure soundness problems in borrowck.  Only the last two commits are unique to this PR.

My understanding of regionck is still evolving, so I'm not sure if this is the right approach.  Feedback is appreciated.

- In `link_reborrowed_region`, we account for the ability of upvars to
  change their mutability due to later processing.  A map of recursive
  region links we may want to establish in the future is maintained,
  with the links being established when the mutability of the borrow
  is adjusted.
- When asked to establish a region link for an upvar, we link it to
  the region of the closure body.  This creates the necessary
  constraint to stop unsound reborrows from the closure environment.

This partially (maybe completely) solves issue #17403.  Remaining work:

- This is only known to help with by-ref upvars.  I have not looked at
  by-value upvars yet to see if they can cause problems.
- The error diagnostics that result from failed region inference are
  pretty inscrutible.
auto merge of #18056 : TeXitoi/rust/shootout-reverse-complement-improvement, r=alexcrichton

This is some improvement as asked and discused here: http://www.reddit.com/r/rust/comments/2j2ij3/benchmark_improvement_reverse_compliment/

Before:
```
real    0m0.396s
user    0m0.280s
sys     0m0.112s
```
after:
```
real    0m0.293s
user    0m0.216s
sys     0m0.076s
```
best C version:
```
real    0m0.135s
user    0m0.132s
sys     0m0.060s
```

Another possibility will be to add a `DoubleEndedIterator::next_two_side()` with a deffault implementation, and specialising it for slices, and use it here (`MutableSlice::reverse()` can then become safe). This benchmark will then be safe.

What do you think?
auto merge of #18052 : IvanUkhov/rust/raw-byte-string-literals, r=aturon

Hello,


The pull request fixes a typo in the description of raw string literals in [reference.md](https://github.com/rust-lang/rust/blob/master/src/doc/reference.md#byte-and-byte-string-literals).


Regards,
Ivan
auto merge of #18089 : gamazeps/rust/small-bitv-cleanup, r=alexcrichton

I was going to write some doc in order to remove the #[allow(missing_doc)] but there was actually none missing.
I also removed a warning i didn't see in my last commit  #18018
Linked to #18009
auto merge of #18093 : steveklabnik/rust/remove_gc_reference, r=alexcrichton