[std::ascii] Add .to_ascii_opt() and .into_ascii_opt() returning Option

… instead of failing.

Make them default methods on the trait, and also make .to_ascii()
a default method while we’re at it.

Conflicts:
	src/libstd/ascii.rs
rustc: Strip struct fields and enum variants

Closes #11085
Rewrite SyntaxEnv

I'd really like to be able to do something like

struct MapChain<'next, K, V> {
    info: BlockInfo,
    map: HashMap<K, V>,
    next: Option<&'next mut MapChain<'next, K, V>
}

but I can't get the lifetimes to work out.
Update documentation to remove reference to ::rt logging
Add testing tutorial to docs
Fix issue #11216 - Replace std::hashmap::{each_key, each_value} with iterators.
Conservatively export all trait methods and impls

The comments have more information as to why this is done, but the basic idea is
that finding an exported trait is actually a fairly difficult problem. The true
answer lies in whether a trait is ever referenced from another exported method,
and right now this kind of analysis doesn't exist, so the conservative answer of
"yes" is always returned to answer whether a trait is exported.

Closes #11224
Closes #11225
Mark provided methods in dead-code pass
rustc::driver: Remove two @s
syntax::diagnostic: Remove unnecessary traits

This removes trait `handler` and `span_handler`,
and renames `HandlerT` to `Handler`, `CodemapT` to `SpanHandler`.
syntax::diagnostic: Remove @ from Emitter
syntax::codemap: Add static DUMMY_SP

It replaces `dummy_sp()`.
auto merge of #11255 : klutzy/rust/small-cleanup, r=pcwalton

This patchset removes some `@`s and unnecessary traits,
and replaces a function (`dummy_sp()`) returning constant value
by static variable.
Update RELEASES.txt for 0.9
Don't leave lingering files in doc tests

Closes #11234
Move task count bookeeping out of libstd

For libgreen, bookeeping should not be global but rather on a per-pool basis.
Inside libnative, it's known that there must be a global counter with a
mutex/cvar.

The benefit of taking this strategy is to remove this functionality from libstd
to allow fine-grained control of it through libnative/libgreen. Notably, helper
threads in libnative can manually decrement the global count so they don't count
towards the global count of threads. Also, the shutdown process of *all* sched
pools is now dependent on the number of tasks in the pool being 0 rather than
this only being a hardcoded solution for the initial sched pool in libgreen.

This involved adding a Local::try_take() method on the Local trait in order for
the channel wakeup to work inside of libgreen. The channel send was happening
from a SchedTask when there is no Task available in TLS, and now this is
possible to work (remote wakeups are always possible, just a little slower).
Fix usage of rustc --ls on invalid files

Closes #11259
auto merge of #11212 : alexcrichton/rust/local-task-count, r=brson

For libgreen, bookeeping should not be global but rather on a per-pool basis.
Inside libnative, it's known that there must be a global counter with a
mutex/cvar.

The benefit of taking this strategy is to remove this functionality from libstd
to allow fine-grained control of it through libnative/libgreen. Notably, helper
threads in libnative can manually decrement the global count so they don't count
towards the global count of threads. Also, the shutdown process of *all* sched
pools is now dependent on the number of tasks in the pool being 0 rather than
this only being a hardcoded solution for the initial sched pool in libgreen.

This involved adding a Local::try_take() method on the Local trait in order for
the channel wakeup to work inside of libgreen. The channel send was happening
from a SchedTask when there is no Task available in TLS, and now this is
possible to work (remote wakeups are always possible, just a little slower).
Add byteswap intrinsics for converting from big/little to host endian

These are similar to the ntoh[s|l] functions in C and have the style of
from_[be|le][16|32|64].
libnative: Use [from|to]_be16 instead of bswap16