Add tests and un-xfail a few issues

Closes #4545
Closes #5791
Closes #6470
Closes #8044
auto merge of #9805 : alexcrichton/rust/needstest, r=brson

Closes #4545
Closes #5791
Closes #6470
Closes #8044
De-pub some private runtime components

This change was waiting for privacy to get sorted out, which should be true now
that #8215 has landed.

Closes #4427
extra::tempfile: replace mkdtemp with an RAII wrapper

this incidentally stops `make check` from leaving directories in `/tmp`
auto merge of #9802 : ben0x539/rust/mkdtemp-raii, r=alexcrichton

this incidentally stops `make check` from leaving directories in `/tmp` (Closes #9764)
auto merge of #9803 : alexcrichton/rust/less-pub2, r=brson

This change was waiting for privacy to get sorted out, which should be true now
that #8215 has landed.

Closes #4427
correct names for `#[no_send]`/`#[no_freeze]` tests
Remove support for older CrateMap versions
clean up the `Rc`/`RcMut` types and move to libstd
auto merge of #9794 : thestinger/rust/rc, r=alexcrichton

I've left out a way to construct from a `Send` type until #9509 is resolved. I am confident that this interface can remain backwards compatible though, assuming we name the `Pointer` trait method `borrow`.

When there is a way to convert from `Send` (`from_send`), a future RAII-based `Mut` type can be used with this to implemented a mutable reference-counted pointer. For now, I've left around the `RcMut` type but it may drastically change or be removed.
auto merge of #9809 : fhahn/rust/remove-old-cratemap-code, r=alexcrichton

This patch removes the code responsible for handling older CrateMap versions (as discussed during #9593). Only the new (safer) layout is supported now.
rustpkg: Set exit codes properly and make tests take advantage of that

When I started writing the rustpkg tests, task failure didn't set the
exit code properly. But bblum's work from July fixed that. Hooray! I
just didn't know about it till now.

So, now rustpkg uses exit codes in a more conventional way, and some of
the tests are simpler.

The bigger issue will be to make task failure propagate the error message.
Right now, rustpkg does most of the work in separate tasks, which means if
a task fails, rustpkg can't distinguish between different types of failure
(see #3408)
auto merge of #9799 : catamorphism/rust/rustpkg-exitcodes, r=catamorphism,metajack

r? @metajack When I started writing the rustpkg tests, task failure didn't set the
exit code properly. But bblum's work from July fixed that. Hooray! I
just didn't know about it till now.

So, now rustpkg uses exit codes in a more conventional way, and some of
the tests are simpler.

The bigger issue will be to make task failure propagate the error message.
Right now, rustpkg does most of the work in separate tasks, which means if
a task fails, rustpkg can't distinguish between different types of failure
(see #3408)
rc: rename borrow to get

Shorter and same name used by Arc
rc, arc: add copy-on-write mutable borrowing to Rc and Arc
rc, arc: add support for by-value copy-on-write and try-to-write

The try_ functions don't require Clone, but they do nothing if rc > 1

The try_unwrap and value take and return by-value instead of &mut
arc: relax kind bounds on non-constructor

They aren't needed, since arcs without the kinds can't be created
with safe code, and unsafe code should be allowed to do whatever it
wants.

This greatly simplifies libraries using Arc<T> who no longer need
to impose those traits unless they construct arcs.