auto merge of #8854 : huonw/rust/rt-papercuts, r=brson

The only user-facing change is handling non-integer (and zero) `RUST_THREADS` more nicely:

```
$ RUST_THREADS=x rustc # old

You've met with a terrible fate, haven't you?

fatal runtime error: runtime tls key not initialized
Aborted
$ RUST_THREADS=x ./x86_64-unknown-linux-gnu/stage2/bin/rustc # new

You've met with a terrible fate, haven't you?

fatal runtime error: `RUST_THREADS` is `x`, should be a positive integer
Aborted
```

The other changes are converting some `for .. in range(x,y)` to `vec::from_fn` or `for .. in x.iter()` as appropriate; and removing a chain of (seemingly) unnecessary pointer casts.

(Also, fixes a typo in `extra::test` from #8823.)
Add missing space
doc/rust.md: Missing in keyword on keyword list.
auto merge of #8857 : blake2-ppc/rust/std-str-remove, r=thestinger

These are very easy to replace with methods on string slices, basically
`.char_len()` and `.len()`.

These are the replacement implementations I did to clean these
functions up, but seeing this I propose removal:

/// ...
pub fn count_chars(s: &str, begin: uint, end: uint) -> uint {
    // .slice() checks the char boundaries
    s.slice(begin, end).char_len()
}

/// Counts the number of bytes taken by the first `n` chars in `s`
/// starting from byte index `begin`.
///
/// Fails if there are less than `n` chars past `begin`
pub fn count_bytes<'b>(s: &'b str, begin: uint, n: uint) -> uint {
    s.slice_from(begin).slice_chars(0, n).len()
}
auto merge of #8867 : thestinger/rust/smaller-arc, r=alexcrichton
auto merge of #8869 : alexcrichton/rust/issue-8847-fix-unused, r=huonw

Closes #8847
auto merge of #8872 : MicahChalmer/rust/emacs-indent-fix, r=pnkfelix

This fixes some, but not all, of the issues mentioned in #8787
auto merge of #8877 : bouk/rust/master, r=sanxiyn

Ran into a missing space in the stdlib source
auto merge of #8858 : blake2-ppc/rust/small-bugs, r=alexcrichton

Fix a bug in `s.slice_chars(a, b)` that did not accept `a == s.len()`.

Fix a bug in `!=` defined for DList.

Also simplify NormalizationIterator to use the CharIterator directly instead of mimicing the iteration itself.
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).
auto merge of #8878 : toqueteos/rust/patch-1, r=sanxiyn

As promised on #8876.
Revert "Teach the makefile to use multiple src-base's"

This reverts commit 43f851d2cb3976655078f032dc1a8cb88f1c8deb.
Revert "Teach compiletest to use multiple --src-base's"

This reverts commit 8a07f5708196dd72ec030018c2a215a4dd823b2e.
Revert "src/test/bench: restructure"

This reverts commit 14cdc26e8a7794e437946f46df5769362b42acdf.
auto merge of #8886 : cmr/rust/test-restructure, r=cmr