llvm: Disable pthread on mingw

llvm supports both win32 native threads and pthread,
but configure tries to find pthread first.
This manually disables pthread to use native api.

This removes libpthreads-2.dll dependency on librustc.
mklldeps.py: Write to file instead of print

It seems that msys automatically converts `\n` to `\r\n` on pipe
redirection, which causes `make tidy` failure.
Register new snapshots

Time for a visit from the snapshot fairy!
auto merge of #11013 : klutzy/rust/win-no-pthread, r=alexcrichton

llvm supports both win32 native threads and pthread,
but configure tries to find pthread first.
This manually disables pthread to use native api.

This removes libpthreads-2.dll dependency on librustc.
Add a rustdoc test

This is just a smoke test which verifies that the expected files are
generated. Also makes the rmake tests have the right deps.
rustdoc: thread through the context for rendering

This partially reverts 8b5a317.
std::vec: remove .as_imm_buf, replaced by .as_ptr & .len.

There's no need for the restrictions of a closure with the above methods.
auto merge of #11032 : cmr/rust/rustdoc_test, r=alexcrichton

This is just a smoke test which verifies that the expected files are
generated.
std::vec: remove .as_muf_buf, replaced by .as_mut_ptr & .len.
std::str: replace .as_imm_buf with .as_ptr.
std::str: remove .as_mut_buf & rewrite/simplify `.push_char`.

`.as_mut_buf` was used exactly once, in `.push_char` which could be
written in a simpler way, using the `&mut ~[u8]` that it already
retrieved. In the rare situation when someone really needs
`.as_mut_buf`-like functionality (getting a `*mut u8`), they can go via
`str::raw::as_owned_vec`.
Fix `sum()` accuracy

`[1e20, 1.0, -1e20].sum()` returns `0.0`. This happens because during
the summation, `1.0` is too small relative to `1e20`, making it
negligible.

I have tried Kahan summation but it hasn't fixed the problem.
Therefore, I've used Python's `fsum()` implementation with some
help from Jason Fager and Huon Wilson.
For more details, read:
www.cs.cmu.edu/~quake-papers/robust-arithmetic.ps

Moreover, benchmark and unit tests were added.

Note: `Status.sum` is still not fully fixed. It doesn't handle
NaNs, infinities and overflow correctly. See issue 11059:
https://github.com/mozilla/rust/issues/11059
auto merge of #11029 : huonw/rust/rm-vec-as-buf, r=cmr

For `str.as_mut_buf`, un-closure-ification is achieved by outright removal (see commit message). The others are replaced by `.as_ptr`, `.as_mut_ptr` and `.len`
Make Android tests fail if no device is available
auto merge of #10927 : g3xzh/rust/sum_bugfix, r=huonw

`[1e20, 1.0, -1e20].sum()` returns `0.0`. This happens because during
the summation, `1.0` is too small relative to `1e20`, making it
negligible.

I have tried Kahan summation but it hasn't fixed the problem.
Therefore, I've used Python's `fsum()` implementation.
For more details, read:
www.cs.cmu.edu/~quake-papers/robust-arithmetic.ps
https://github.com/mozilla/rust/issues/10851

Python's fsum (msum)
http://code.activestate.com/recipes/393090/

@huonw, your feedback is more than welcome.
It looks unpolished; Do you have suggestions how to make it more beautiful and elegant?

Thanks in advance,
std::vec: replace .insert with a small amount of unsafe code.

This makes the included benchmark more than 3 times faster. Also,
`.unshift(x)` is now faster as `.insert(0, x)` which can reuse the
allocation if necessary.
auto merge of #10977 : brson/rust/androidtest, r=brson

#10975

For a while I thought the android test bot was succeeding but it wasn't really testing anything at all.
std::str: fix .slice_chars example. Fixes #11014.
auto merge of #11050 : alexcrichton/rust/snapshots, r=brson

Time for a visit from the snapshot fairy!
Upgrade libuv to fix a leak on OSX

I haven't landed this fix upstream just yet, but it's opened as
joyent/libuv#1048. For now, I've locally merged it into my fork, and I've
upgraded our repo to point to the new revision.

Closes #11027