rustc: Add a lint for the obsolete crate-level link attribute
extra: impl IterBytes for uuid::Uuid
auto merge of #11091 : brson/rust/cratelinkattr, r=brson

This is set to *forbid* and prints a note explaining how to fix the problem.
auto merge of #11130 : olsonjeffery/rust/master, r=alexcrichton

So that `Uuid` can be used as the key in a `HashMap` or in a `HashSet`, etc

The only question I have about this is: Is endianness an issue, here? If so, what's the correct way to proceed?
std: Introduce a Runtime trait

This trait is used to abstract the differences between 1:1 and M:N scheduling
and is the sole dispatch point for the differences between these two scheduling
modes.

This, and the following series of commits, is not intended to compile. Only
after the entire transition is complete are programs expected to compile.
std: Introduce an unstable::stack module

This module will be used to manage the OS-specific TLS registers used to specify
the bounds of the current rust stack (useful in 1:1 and M:N)
std: Delete rt::test

This module contains many M:N specific concepts. This will no longer be
available with libgreen, and most functions aren't really that necessary today
anyway. New testing primitives will be introduced as they become available for
1:1 and M:N.

A new io::test module is introduced with the new ip4/ip6 address helpers to
continue usage in io tests.
std: Introduce std::sync

For now, this moves the following modules to std::sync

* UnsafeArc (also removed unwrap method)
* mpsc_queue
* spsc_queue
* atomics
* mpmc_bounded_queue
* deque

We may want to remove some of the queues, but for now this moves things out of
std::rt into std::sync
std: Expose that LocalIo may not always be available

It is not the case that all programs will always be able to acquire an instance
of the LocalIo borrow, so this commit exposes this limitation by returning
Option<LocalIo> from LocalIo::borrow().

At the same time, a helper method LocalIo::maybe_raise() has been added in order
to encapsulate the functionality of raising on io_error if there is on local I/O
available.
std: Handle prints with literally no context

Printing is an incredibly useful debugging utility, and it's not much help if
your debugging prints just trigger an obscure abort when you need them most. In
order to handle this case, forcibly fall back to a libc::write implementation of
printing whenever a local task is not available.

Note that this is *not* a 1:1 fallback. All 1:1 rust tasks will still have a
local Task that it can go through (and stdio will be created through the local
IO factory), this is only a fallback for "no context" rust code (such as that
setting up the context).
std: Make logging safely implemented

This commit fixes the logging function to be safely implemented, as well as
forcibly requiring a task to be present to use logging macros. This is safely
implemented by transferring ownership of the logger from the task to the local
stack frame in order to perform the print. This means that if a logger does more
logging while logging a new one will be initialized and then will get
overwritten once the initial logging function returns.

Without a scheme such as this, it is possible to unsafely alias two loggers by
logging twice (unsafely borrows from the task twice).
std: Change Any::move to never consume the object

If the dynamic cast fails, this now returns the ~Any instance back to the
caller.
rustuv: Reimplement without using std::rt::sched

This reimplements librustuv without using the interfaces provided by the
scheduler in libstd. This solely uses the new Runtime trait in order to
interface with the local task and perform the necessary scheduling operations.

The largest snag in this refactoring is reimplementing homing. The new runtime
trait exposes no concept of "homing" a task or forcibly sending a task to a
remote scheduler (there is no concept of a scheduler). In order to reimplement
homing, the transferrence of tasks is now done at the librustuv level instead of
the scheduler level. This means that all I/O loops now have a concurrent queue
which receives homing messages and requests.

This allows the entire implementation of librustuv to be only dependent on the
runtime trait, severing all dependence of librustuv on the scheduler and related
green-thread functions.

This is all in preparation of the introduction of libgreen and libnative.

At the same time, I also took the liberty of removing all glob imports from
librustuv.
std: Move management of the exit code to std::os

Previously this functionality was located in std::rt::util, but there's no real
reason for it to be located in there.
std: Reimplement std::comm without the scheduler

Like the librustuv refactoring, this refactors std::comm to sever all ties with
the scheduler. This means that the entire `comm::imp` module can be deleted in
favor of implementations outside of libstd.
native: Introduce libnative

This commit introduces a new crate called "native" which will be the crate that
implements the 1:1 runtime of rust. This currently entails having an
implementation of std::rt::Runtime inside of libnative as well as moving all of
the native I/O implementations to libnative.

The current snag is that the start lang item must currently be defined in
libnative in order to start running, but this will change in the future.

Cool fact about this crate, there are no extra features that are enabled.

Note that this commit does not include any makefile support necessary for
building libnative, that's all coming in a later commit.
green: Rip the bandaid off, introduce libgreen

This extracts everything related to green scheduling from libstd and introduces
a new libgreen crate. This mostly involves deleting most of std::rt and moving
it to libgreen.

Along with the movement of code, this commit rearchitects many functions in the
scheduler in order to adapt to the fact that Local::take now *only* works on a
Task, not a scheduler. This mostly just involved threading the current green
task through in a few locations, but there were one or two spots where things
got hairy.

There are a few repercussions of this commit:

* tube/rc have been removed (the runtime implementation of rc)
* There is no longer a "single threaded" spawning mode for tasks. This is now
  encompassed by 1:1 scheduling + communication. Convenience methods have been
  introduced that are specific to libgreen to assist in the spawning of pools of
  schedulers.
std: Fix a bug where Local::take() didn't zero out

In the compiled version of local_ptr (that with #[thread_local]), the take()
funciton didn't zero-out the previous pointer, allowing for multiple takes (with
fewer runtime assertions being tripped).
std: Update std::rt::thread to specify stack sizes

It's now possible to spawn an OS thread with a stack that has a specific size.
make: Add all the make support for lib{native,green}

This should now begin distribution of lib{green,native} in rlib/dylib format as
well as building them as part of the normal build process.