libstd: Refactor Duration.

This changes the internal representation of `Duration` from

    days: i32,
    secs: i32,
    nanos: u32

to

    secs: i64,
    nanos: i32

This resolves #16466. Some methods now take `i64` instead of `i32` due
to the increased range. Some methods, like `num_milliseconds`, now
return an `Option<i64>` instead of `i64`, because the range of
`Duration` is now larger than e.g. 2^63 milliseconds.
libstd: Limit Duration range to i64 milliseconds.

This enables `num_milliseconds` to return an `i64` again instead of
`Option<i64>`, because it is guaranteed not to overflow.

The Duration range is now rougly 300e6 years (positive and negative),
whereas it was 300e9 years previously. To put these numbers in
perspective, 300e9 years is about 21 times the age of the universe
(according to Wolfram|Alpha). 300e6 years is about 1/15 of the age of
the earth (according to Wolfram|Alpha).
Add support for trailing commas in more places

This lets the parser understand trailing commas in method calls, method
definitions, enum variants, and type parameters.

Closes #14240.
Closes #15887.
librustc: Don't ICE with type when name only contain underscores.
extern crate foobar as foo;

Implements remaining part of RFC #47.
Addresses issue #16461.

Removed link_attrs from rust.md, they don't appear to be supported by
the parser.

Changed all the tests to use the new extern crate syntax

Change pretty printer to use 'as' syntax
Log linker stderr and stdout.
lint: Improve camel case suggestion when empty.
Fix const evaluation of cast expression from bool
Adjust the error messages to match the pattern "expected foo, found bar"

Closes #8492
doc: remove trailing shell prompts

because eyesore
doc: remove misleading/confusing info

We have to specify the module and the function name in the example where
the module shares a crate with the executable as well, so remove the
redundant (and potentially confusing) mention.
auto merge of #16718 : Sawyer47/rust/bool-cast, r=pcwalton

Current version of rust fails when casting from bool, e.g.
```rust
fn main() {
    let _a = false as uint;
    let _b = true as uint;
    let _c: [bool, ..false as uint];
    let _d: [bool, ..true as uint];
    // _a and _b work, but _c and _d result in an error
    // error: expected constant expr for vector length: can't cast str to uint
}
```
This commit makes it work as expected.
auto merge of #16646 : P1start/rust/trailing-commas, r=alexcrichton

This lets the parser understand trailing commas in method calls, method definitions, enum variants, and type parameters.

Closes #14240.
Closes #15887.
auto merge of #16694 : vadimcn/rust/debug-linker, r=alexcrichton

Shows linker spew even when linking succeeds.  This is occasionally useful in order to see verbose linker output.
native: Implement clone/close_accept for unix

This commits implements {Tcp,Unix}Acceptor::{clone,close_accept} methods for
unix. A windows implementation is coming in a later commit.

The clone implementation is based on atomic reference counting (as with all
other clones), and the close_accept implementation is based on selecting on a
self-pipe which signals that a close has been seen.
rustuv: Implement clone/close_accept

This commits implements {Tcp,Unix}Acceptor::{clone,close_accept} methods for
all of librustuv.

This implementation rewrites much of Access, AccessTimeout, and AcceptTimeout to
have type parameter for shared state that all acceptors share (a shared queue of
sockets). The incoming/outgoing channels have been removed as all timeouts and
such are now managed on the event loop rather than concurrently.
native: TCP close/close_accept for windows

This commit implements TcpAcceptor::{close, close_accept} for windows via
WSAEVENT types.
native: Add some documentation for accept

Document the new code for how close_accept and timeouts are implemented.
native: clone/close_accept for win32 pipes

This commits takes a similar strategy to the previous commit to implement
close_accept and clone for the native win32 pipes implementation.

Closes #15595
auto merge of #15704 : alexcrichton/rust/issue-15595, r=brson

If a task is spinning in an accept loop, there is currently no method of gracefully shutting it down. This PR introduces a way to do so by cloning the acceptor and implementing a close_accept method to unblocking any pending acceptor.

As with other I/O methods like this, it is `#[experimental]` from the start and sadly carries with it a good deal of code to support it. Much of the complication is from the fact that you can now concurrently accept on the same socket.

I tried to add a good deal of tests for this change, but another set of eyes is always appreciated!