syntax: allow `trace_macros!` and `log_syntax!` in item position.

Previously

    trace_macros!(true)
    fn main() {}

would complain about `trace_macros` being an expression macro in item
position. This is a pointless limitation, because the macro is purely
compile-time, with no runtime effect. (And similarly for log_syntax.)

This also changes the behaviour of `trace_macros!` very slightly, it
used to be equivalent to

    macro_rules! trace_macros {
        (true $($_x: tt)*) => { true };
        (false $($_x: tt)*) => { false }
    }

I.e. you could invoke it with arbitrary trailing arguments, which were
ignored. It is changed to accept only exactly `true` or `false` (with no
trailing arguments) and expands to `()`.
native: Fix a possible deadlock in spawn

The OSX bots have been deadlocking recently in the rustdoc tests. I have only
been able to rarely reproduce the deadlock on my local setup. When reproduced,
it looks like the child process is spinning on the malloc mutex, which I
presume is locked with no other threads to unlock it.

I'm not convinced that this is what's happening, because OSX should protect
against this with pthread_atfork by default. Regardless, running as little code
as possible in the child after fork() is normally a good idea anyway, so this
commit moves all allocation to the parent process to run before the child
executes.

After running 6k iterations of rustdoc tests, this deadlocked twice before, and
after 20k iterations afterwards, it never deadlocked. I draw the conclusion that
this is either sweeping the bug under the rug, or it did indeed fix the
underlying problem.
std: Add an I/O reader method to fill a buffer

I've found a common use case being to fill a slice (not an owned vector)
completely with bytes. It's posible for short reads to happen, and if you're
trying to get an exact number of bytes then this helper will be useful.
rand: Use fill() instead of read()

It's possible for a reader to have a short read, and there's no reason the task
should fail in this scenario. By using fill(), this has a stronger guarantee
that the buffer will get filled with data.
rustc: Change the filename of compressed bitcode

Fixes #12992
Store compressed bitcode files in rlibs with a different extension. Compression doesn't interfere with --emit=bc.
Regression test compares outputs.
Snapshot cleanup
std: Move NativeMutex from &mut self to &self

The proper usage of shared types is now sharing through `&self` rather than
`&mut self` because the mutable version will provide stronger guarantees (no
aliasing on *any* thread).
sync: Move the concurrent queue to using &self

This commit also lifts it up a level in the module hierarchy in the soon-to-come
reorganization of libsync.
sync: Move the Mutex type to using &self

This also uses the Unsafe type for any interior mutability in the type to avoid
transmutes.
sync: Move Once to using &self

Similarly to the rest of the previous commits, this moves the once primitive to
using &self instead of &mut self for proper sharing among many threads now.
sync: Rewrite the base primitives

This commit rewrites the core primitives of the sync library: Mutex, RWLock, and
Semaphore. These primitives now have updated, more modernized apis:

* Guards are returned instead of locking with closures. All condition variables
  have moved inside the guards and extraneous methods have been removed.
* Downgrading on an rwlock is now done through the guard instead of the rwlock
  itself.

These types are meant to be general locks, not locks of an internal type (for
external usage). New types will be introduced for locking shared data.
sync: Introduce new wrapper types for locking

This introduces new synchronization types which are meant to be the foundational
building blocks for sharing data among tasks. The new Mutex and RWLock types
have a type parameter which is the internal data that is accessed. Access to the
data is all performed through the guards returned, and the guards all have
autoderef implemented for easy access.
serialize: Read/emit tuples with {read,emit}_tuple

This commit moves from {read,emit}_seq for tuples to {read,emit}_tuple, as well
as providing a generalized macro for generating these implementations from one
invocation.

Closes #13086
auto merge of #13074 : pczarn/rust/build-rlib, r=alexcrichton

Fixes #12992

I tried to increase the number of deflate's probes. Reduction of 0.5% or 2% is not enough.
This commit cleans up a few test warnings
auto merge of #13095 : alexcrichton/rust/serialize-tuple, r=huonw

This commit moves from {read,emit}_seq for tuples to {read,emit}_tuple, as well
as providing a generalized macro for generating these implementations from one
invocation.

Closes #13086
docs: named lifetimes

* Include tip given by Leo Testard in mailing list about labeled `break`
and `continue`:
https://mail.mozilla.org/pipermail/rust-dev/2014-March/009145.html
* cross-reference named lifetimes in tutorial -> lifetimes guide
* Broke named lifetimes section into two sub-sections.
* Added mention of `'static` lifetime.
auto merge of #13096 : sstewartgallus/rust/cleanup-test-warnings, r=huonw
Added suggested notes

* Note on while loop not supporting named breaks.
* Note on hygienic macros (and example of such within loops)
Documentation sprint: Terminfo