Add a variant of home_for_io that consumes the handle. Refactor out common parts of the home_for_io variants.
Split out starting a listener from accepting incoming connections.

The Listener trait takes two type parameters, the type of connection and the type of Acceptor,
and specifies only one method, listen, which consumes the listener and produces an Acceptor.

The Acceptor trait takes one type parameter, the type of connection, and defines two methods.
The accept() method waits for an incoming connection attempt and returns the result.
The incoming() method creates an iterator over incoming connections and is a default method.

Example:

let listener = TcpListener.bind(addr); // Bind to a socket
let acceptor = listener.listen(); // Start the listener
for stream in acceptor.incoming() {
    // Process incoming connections forever (or until you break out of the loop)
}
std::iterator: Introduce trait ExactSizeHint

The trait `ExactSizeHint` is introduced to solve a few small niggles:

* We can't reverse (`.invert()`) an enumeration iterator
* for a vector, we have `v.iter().position(f)` but `v.rposition(f)`.
* We can't reverse `Zip` even if both iterators are from vectors

`ExactSizeHint` is an empty trait that is intended to indicate that an
iterator, for example `VecIterator`, knows its exact finite size and
reports it correctly using `.size_hint()`. Only adaptors that preserve
this at all times, can expose this trait further. (Where here we say
finite for fitting in uint).
std::iterator: Implement .next_back() for Zip

Let Zip be double-ended when both its children have the ExactSizeHint
trait.
std::iterator: Add tests for .next_back() on Zip and Enumerate
std: Implement .rposition() on double-ended iterators with known size

This is a generalization of the vector .rposition() method, to all
double-ended iterators that have the ExactSizeHint trait.

This resolves the slight asymmetry around `position` and `rposition`

* position from front is `vec.iter().position()`
* position from the back was, `vec.rposition()` is now `vec.iter().rposition()`

Additionally, other indexed sequences (only `extra::ringbuf` I think),
will have the same method available once it implements ExactSizeHint.
std::str: Use reverse enumerate and .rposition

Simplify code by using the reversibility of enumerate and use
.rposition().
std::select: Use correct indices from the front

Caught a bug where .enumerate() was used on a reverse iterator. The
indices should be counted from the front here (bblum confirms).
std::iterator: Add back .rposition() test
std::iterator: Use ExactSize, inheriting DoubleEndedIterator

Address discussion with acrichto; inherit DoubleEndedIterator so that
`.rposition()` can be a default method, and that the nische of the trait
is clear. Use assertions when using `.size_hint()` in reverse enumerate
and `.rposition()`
std/extra: Add ExactSize for Bitv, DList, RingBuf, Option iterators
Implement BufReader
Raise the file descriptor limits when running compiletest

We already do this for libstd tests automatically, and compiletest runs into the
same problems where when forking lots of processes lots of file descriptors are
created. On OSX we can use specific syscalls to raise the limits, in this
situation, though.

Closes #8904
Don't have format! move out of local variables
add type name to the tydesc

Closes #8926
repr: add very basic support for functions

Closes #8917
auto merge of #8884 : blake2-ppc/rust/exact-size-hint, r=huonw

The message of the first commit explains (edited for changed trait name):

The trait `ExactSize` is introduced to solve a few small niggles:

* We can't reverse (`.invert()`) an enumeration iterator
* for a vector, we have `v.iter().position(f)` but `v.rposition(f)`.
* We can't reverse `Zip` even if both iterators are from vectors

`ExactSize` is an empty trait that is intended to indicate that an
iterator, for example `VecIterator`, knows its exact finite size and
reports it correctly using `.size_hint()`. Only adaptors that preserve
this at all times, can expose this trait further. (Where here we say
finite for fitting in uint).

---

It may seem complicated just to solve these small "niggles",
(It's really the reversible enumerate case that's the most interesting)
but only a few core iterators need to implement this trait.

While we gain more capabilities generically for some iterators,
it becomes a tad more complicated to figure out if a type has
the right trait impls for it.
Implement support for indicating the stability of items.

There are 6 new compiler recognised attributes: deprecated, experimental,
unstable, stable, frozen, locked (these levels are taken directly from
Node's "stability index"[1]). These indicate the stability of the
item to which they are attached; e.g. `#[deprecated] fn foo() { .. }`
says that `foo` is deprecated.

This comes with 3 lints for the first 3 levels (with matching names) that
will detect the use of items marked with them (the `unstable` lint
includes items with no stability attribute). The attributes can be given
a short text note that will be displayed by the lint. An example:

    #[warn(unstable)]; // `allow` by default

    #[deprecated="use `bar`"]
    fn foo() { }

    #[stable]
    fn bar() { }

    fn baz() { }

    fn main() {
        foo(); // "warning: use of deprecated item: use `bar`"

        bar(); // all fine

        baz(); // "warning: use of unmarked item"
    }

The lints currently only check the "edges" of the AST: i.e. functions,
methods[2], structs and enum variants. Any stability attributes on modules,
enums, traits and impls are not checked.

[1]: http://nodejs.org/api/documentation.html
[2]: the method check is currently incorrect and doesn't work.
auto merge of #8947 : thestinger/rust/name, r=huonw

Storing the type name in the `tydesc` aims to avoid the need to pass a type name in almost every single visitor method.

It would likely be much saner for `repr` to simply be passed the `TyDesc` corresponding to the function or just the type name, but this is good enough for now.
auto merge of #8945 : alexcrichton/rust/ifmt-dont-move, r=thestinger