rt::io: Add Bytes iterator for Reader

An iterator that simply calls `.read_bytes()` each iteration.

I think choosing to own the Reader value and implementing Decorator to
allow extracting it is the most generically useful. The Reader type
variable can of course be some kind of reference type that implements
Reader.
Fix inner statics having the same symbol name

Before, the path name for all items defined in methods of traits and impls never
took into account the name of the method. This meant that if you had two statics
of the same name in two different methods the statics would end up having the
same symbol named (even after mangling) because the path components leading to
the symbol were exactly the same (just __extensions__ and the static name).

It turns out that if you add the symbol "A" twice to LLVM, it automatically
makes the second one "A1" instead of "A". What this meant is that in local crate
compilations we never found this bug. Even across crates, this was never a
problem. The problem arises when you have generic methods that don't get
generated at compile-time of a library. If the statics were re-added to LLVM by
a client crate of a library in a different order, you would reference different
constants (the integer suffixes wouldn't be guaranteed to be the same).

This fixes the problem by adding the method name to symbol path when building
the ast_map. In doing so, two symbols in two different methods are disambiguated
against.
Remove __extensions__ in names for a "pretty name"

As with the previous commit, this is targeted at removing the possibility of
collisions between statics. The main use case here is when there's a
type-parametric function with an inner static that's compiled as a library.
Before this commit, any impl would generate a path item of "__extensions__".
This changes this identifier to be a "pretty name", which is either the last
element of the path of the trait implemented or the last element of the type's
path that's being implemented.  That doesn't quite cut it though, so the (trait,
type) pair is hashed and again used to append information to the symbol.

Essentially, __extensions__ was removed for something nicer for debugging, and
then some more information was added to symbol name by including a hash of the
trait being implemented and type it's being implemented for. This should prevent
colliding names for inner statics in regular functions with similar names.
rt::io: Rename Bytes to ByteIterator and add note about iteration
Move llvm into the artifacts build directory
Raise errors on format strings with unmatched `}`

Otherwise extra stuff after a lone '}' character is simply ignored, which is
very bad.

Closes #8938
Move the llvm auto-clean stamp into $target/llvm
Build rustllvm into $target/rustllvm
Added explicit pub to several conditions.  Enables completion of #6009.
Make non-pub condition! expand to non-pub mod.  Fix #6009.
Revise path.rs API to not allocate ~str so much.

Note that I left dirname as returning ~str, because both of its
implementations work by calling dir_path, which produces a new path,
and thus we cannot borrow the result from &'a self passed to dirname
(because the new path returned by dir_path will not live long enough
to satisfy the lifetime 'a).
Update clients of path.rs to use new API.

In most cases this involved removing a ~str allocations or clones
(yay), or coercing a ~str to a slice.  In a few places, I had to bind
an intermediate Path (e.g. path.pop() return values), so that it would
live long enough to support the borrowed &str.

And in a few places, where the code was actively using the property
that the old API returned ~str's, I had to put in to_owned() or
clone(); but in those cases, we're trading an allocation within the
path.rs code for one in the client code, so they neutralize each
other.
Another followup on #6009.

Odd that my earlier make checks did not catch this.
auto merge of #8935 : blake2-ppc/rust/reader-bytes, r=brson

An iterator that simply calls `.read_bytes()` each iteration.

I think choosing to own the Reader value and implementing Decorator to
allow extracting it is the most generically useful. The Reader type
variable can of course be some kind of reference type that implements
Reader.

In the generic form the `Bytes` iterator is well behaved itself and does not read ahead.
It performs abysmally on top of a FileStream, and much better if a buffering reader is inserted inbetween.
auto merge of #8977 : pnkfelix/rust/fsk-followup-on-6009-rebased, r=alexcrichton

Fix #6009.  Rebased version of #8970.  Inherits review from alexcrichton.
Fix #7740: gather_loans should not recur into the items of the block.

gather_loans does not need to recurse into any items declared in the
current block.  Rather than special-case `fk_item_fn` and `fk_method`,
just make the GatherLoanVisitor's visit_item method a no-op.

This indirectly implies that the example of #7740 is fixed:

    fn f() {
        static A: &'static char = &'A';
    }

Since we do not recurse into items, we no longer encounter `&'A'`.
Implement Stream automatically for Reader + Writer

This is consistent with the existing documentation but was not the
actual behaviour, which I've found to be rather a nuisance, actually.
auto merge of #8978 : pnkfelix/rust/make-path-api-less-allocation-happy, r=huonw

A [dialogue](https://github.com/mozilla/rust/pull/8909#discussion-diff-6102725) on PR #8909 inspired me to make this change.

r? anyone

(It is possible that `std::path` itself will soon be replaced with a new implementation that kballard's working on, as mentioned in the dialogue linked above, but this revision is simple enough that I figured I'd offer it up.)
Remove spurious comment in test for #1866.

It's no longer xfailed.
auto merge of #8986 : metajack/rust/rem-1866-xfail-comment, r=huonw

It's no longer xfailed.