Work around #8256, do not fail the task, just return None
std: Use correct lifetime parameter on str::raw::slice_bytes

fn slice_bytes is marked unsafe since it allows violating the valid
string encoding property; but the function did also allow extending the
lifetime of the slice by mistake, since it's returning `&str`.

Use the annotation `slice_bytes<'a>(&'a str, ...) -> &'a str` so
that all uses of slice_bytes are region checked correctly.
std: Add .consume_iter() for Option, to make it reusable

Let Option be a base for a widely useful one- or zero- item iterator.
Refactor OptionIterator to support any generic element type, so the same
iterator impl can be used for both &T, &mut T and T iterators.
std: Convert Result to use external iterators

convert iter() and iter_err() for Result. Use OptionIterator.
std: Remove unused trait bound in Result::map
std: Implement RandomAccessIterator for Invert
std: Improve vec::ChunkIter

Implement clone, bidirectionality and random access for this iterator
std: Add iterator::Repeat to repeat an element endlessly
std: Rewrite the HashSet set operation iterators

Use the Repeat iterator to carry the "explicit closure capture" that was
previously done with the custom EnvFilterIterator.
std: Use method name Option::consume

With Option as the simplest container, `consume` is the way to turn it
into a by-value iterator.
std: Improve the documentation for iterator::Invert
extra: Simplify the bitv iterators using Repeat
std: Remove uint::iterate, replaced by `range`
std: Fix bug in ChunkIter::idx

ChunkIter .idx() didn't handle overflow correctly, even though it tried.
auto merge of #8278 : cmr/rust/workaround, r=brson
auto merge of #8265 : blake2-ppc/rust/std-iter, r=thestinger

Fix #8228 by replacing .iter() and .iter_err() in Result by external iterators.

Implement random access for `iterator::Invert` and `vec::ChunkIter` (and bidirectionality).

Implement Repeat iterator.
Move EnumSet into libextra
auto merge of #8054 : sammykim/rust/move-EnumSet, r=alexcrichton

Fix #8004
auto merge of #8308 : blake2-ppc/rust/str-slice-bytes, r=alexcrichton

`fn slice_bytes` is marked unsafe since it allows violating the valid
string encoding property; but the function did also allow extending the
lifetime of the slice by mistake, since it's returning `&str`.

Use the annotation `slice_bytes<'a>(&'a str, ...) -> &'a str` so
that all uses of `slice_bytes` are region checked correctly.