Remove Freeze bounds from sync::MutexArc

With Rc no longer trying to statically prevent cycles (and thus no
longer using the Freeze bound), it seems appropriate to remove that
restriction from MutexArc as well.
std: iteratize str::is_utf16 & add tests.

Most of the tests are randomly generated with Python 3 and rely on it's
UTF-16be encoder/decoder being correct.
std: convert str::from_utf16 to an external iterator.

Fixes #12316.
str: provide lossy UTF-16 support.

This replaces the iterator with one that handles lone surrogates
gracefully and uses that to implement `from_utf16_lossy` which replaces
invalid `u16`s with U+FFFD.
std: decode even numbered non-BMP planes in the UTF-16 decoder.

Fixes #12318.
std: make str::from_utf16 return an Option.

The rest of the codebase is moving toward avoiding `fail!` so we do it
here too!
Remove the compile-fail test that's now obsolete
Test ordering of glue_drop and glue_takew in self-re-assignment. Closes #3290.
Made fail_bounds_check more careful with strings.

Fixes GH #11976.
auto merge of #12330 : nick29581/rust/glue, r=huonw

closes #3290
auto merge of #12336 : kballard/rust/mutexarc-no-freeze, r=alexcrichton

With Rc no longer trying to statically prevent cycles (and thus no
longer using the Freeze bound), it seems appropriate to remove that
restriction from MutexArc as well.

Closes #9251.
auto merge of #12357 : chromatic/rust/gh_11976_fail_bounds_check_str, r=alexcrichton

Fixes #11976.
auto merge of #12359 : alexcrichton/rust/update-compiler-rt, r=luqmana

Closes #12356
Make priavcy checking aware that a `use` directive can point to two defintions (namespaces) with different privacy. Closes #4110
auto merge of #12245 : nick29581/rust/priv2, r=alexcrichton

closes #4110
str: add a function for truncating a vector of u16 at NUL.

Many of the functions interacting with Windows APIs allocate a vector of
0's and do not retrieve a length directly from the API call, and so need
to be sure to remove the unmodified junk at the end of the vector.
auto merge of #12317 : huonw/rust/utf16, r=alexcrichton

Iterators! Use them (in `is_utf16`), create them (in `utf16_items`).

Handle errors gracefully (`from_utf16_lossy`) and `from_utf16` returning `Option<~str>` instead of failing.

Add a pile of tests.
rustdoc: Only inject extern crates if not present
auto merge of #12361 : sfackler/rust/rustdoc-test-extern, r=alexcrichton
rustdoc: Fixup links to enum variants

Pages aren't emitted for enum variants, so whenever we're linking to an enum
variant instead link to the parent enum instead.

Closes #12289