std: Replace num::IntConvertible with {To,From}Primitive
syntax: Add #[deriving(FromPrimitive)] syntax extension

Right now this only works for c-style enums.
syntax: swap from .span_fatal to .span_err in #[deriving(FromPrimitive)]
test: add compile-fail test for #[deriving(FromPrimitive)]
std: Swap {To,From}Primitive to use the 64bit as the unimplemented version

One downside with this current implementation is that since BigInt's
default is now 64 bit, we can convert larger BigInt's to a primitive,
however the current implementation on 32 bit architectures does not
take advantage of this fact.
extra: Add ToBigInt and ToBigUint traits
Fix thread safety issues in dynamic_lib

The root issue is that dlerror isn't reentrant or even thread safe.

The Windows code isn't affected since errno is thread-local on Windows
and it's running in an atomically block to ensure there isn't a green
thread context switch.

Closes #8156
Make a task name use a `SendStr`, allowing for either
static or owned strings
Implemented `IntoSendStr` on `SendStr` to allow naming a
task with a `SendStr` directly
auto merge of #9731 : Kimundi/rust/SendStrTaskName, r=alexcrichton

This resolves a FIXME in `std::rt::task`.
std: check bounds for ints/uints in {To,From}Primitive
extra: Don't truncate {u64,i64} when converting to BigInts
std: fix some warnings
std: ToPrimitive's default impls should use `.to_*()`

This allows the default methods to be properly range checked.
std: add Primitive.is_signed
test: fix the tests for windows
extra: fix BigInt on 32bit machines
auto merge of #9250 : erickt/rust/num, r=erickt

This PR solves one of the pain points with c-style enums. Simplifies writing a fn to convert from an int/uint to an enum. It does this through a `#[deriving(FromPrimitive)]` syntax extension.

Before this is committed though, we need to discuss if `ToPrimitive`/`FromPrimitive` has the right design (cc #4819). I've changed all the `.to_int()` and `from_int()` style functions to return `Option<int>` so we can handle partial functions. For this PR though only enums and `extra::num::bigint::*` take advantage of returning None for unrepresentable values. In the long run it'd be better if `i64.to_i8()` returned `None` if the value was too large, but I'll save this for a future PR.

Closes #3868.
auto merge of #9713 : sfackler/rust/dynamic_lib, r=alexcrichton

The root issue is that dlerror isn't reentrant or even thread safe.

The solution implemented here is to make a yielding spin lock over an
AtomicFlag. This is pretty hacky, but the best we can do at this point.
As far as I can tell, it isn't possible to create a global mutex without
having to initialize it in a single threaded context.

The Windows code isn't affected since errno is thread-local on Windows
and it's running in an atomically block to ensure there isn't a green
thread context switch.

Closes #8156
remove duplicate statement