fs: use an iterative algorithm for 'mkdir_recursive'

as requested in #6109
fs: use an iterative algorithm for 'rmdir_recursive'

For now, the windows version uses stat, just as before.
We should switch back to lstat as soon as #12795 is closed.
fs: units tests for mkdir_recusive and rmdir_recursive

The rmdir test is blocked by #12795 on windows.
collections: move hashmap's example to the struct.

Most people go straight to the struct, not looking at the module, so the
example was well hidden.
collections: Don't recurse in hashmap robin_hood

This switches a "tail call" to a manual loop to get around LLVM not optimizing
to a tail call.

Close #12860
auto merge of #12573 : lbonn/rust/unrecurs, r=alexcrichton

As mentioned in #6109, ```mkdir_recursive``` doesn't really need to use recursive calls, so here is an iterative version.
The other points of the proposed overhaul (renaming and existing permissions) still need to be resolved.

I also bundled an iterative ```rmdir_recursive```, for the same reason.

Please do not hesitate to provide feedback on style as this is my first code change in rust.
std: Rename Chan/Port types and constructor

* Chan<T> => Sender<T>
* Port<T> => Receiver<T>
* Chan::new() => channel()
* constructor returns (Sender, Receiver) instead of (Receiver, Sender)
* local variables named `port` renamed to `rx`
* local variables named `chan` renamed to `tx`

Closes #11765
Refactored while_some (libstd/option.rs)

The old 'while' needed to match 2 times for each iteration. With the new
'loop' there is just one match needed.

I have also replaced 'blk' by 'f' to be more consistent with parameter
names in other functions that are implemented for Option
auto merge of #12815 : alexcrichton/rust/chan-rename, r=brson

* Chan<T> => Sender<T>
* Port<T> => Receiver<T>
* Chan::new() => channel()
* constructor returns (Sender, Receiver) instead of (Receiver, Sender)
* local variables named `port` renamed to `rx`
* local variables named `chan` renamed to `tx`

Closes #11765
Fix and improve inline assembly.

Read+write modifier
Some documentation in asm.rs
rpass and cfail tests
io: Bind to shutdown() for TCP streams

This is something that is plausibly useful, and is provided by libuv. This is
not currently surfaced as part of the `TcpStream` type, but it may possibly
appear in the future. For now only the raw functionality is provided through the
Rtio objects.
rustc: make stack traces print for .span_bug/.bug.

Previously a call to either of those to diagnostic printers would defer
to the `fatal` equivalents, which explicitly silence the stderr
printing, including a stack trace from `RUST_LOG=std::rt::backtrace`.

This splits the bug printers out to their own diagnostic type so that
things work properly.

Also, this removes the `Ok(...)` that was being printed around the
subtask's stderr output.
std: Demangle more escapes in backtraces

The rust compiler not only outputs symbols in the form that C++ does, but it
also mangle symbols like '&' and '~' to special compiler-defined escape
sequences. For convenience, these symbols are demangled when printing
backtraces.
rustc: Prevent collisions in names of closures

This commit goes back to using `gensym` to generate unique tokens to put into
the names of closures, allowing closures to be able to get demangled in
backtraces.

Closes #12400
lint: add lint for use of a `~[T]`.

This is useless at the moment (since pretty much every crate uses
`~[]`), but should help avoid regressions once completely removed from a
crate.
std: render the vec_ng docs.

These are wildly incomplete, but having something there is better than
nothing, e.g. so that people know it exists, and many of the functions
behaviour can be guessed from the name or by checking the source: it's
knowing they exist at all that's the hard part.
auto merge of #12798 : pczarn/rust/inline-asm, r=alexcrichton

## read+write modifier '+'
This small sugar was left out in the original implementation (#5359).
 
When an output operand with the '+' modifier is encountered, we store the index of that operand alongside the expression to create and append an input operand later. The following lines are equivalent:
```
asm!("" : "+m"(expr));
asm!("" : "=m"(expr) : "0"(expr));
```
## misplaced options and clobbers give a warning
It's really annoying when a small typo might change behavior without any warning.
```
asm!("mov $1, $0" : "=r"(x) : "r"(8u) : "cc" , "volatile");
//~^ WARNING expected a clobber, but found an option
```
## liveness
Fixed incorrect order of propagation.
Sometimes it caused spurious warnings in code: `warning: value assigned to `i` is never read, #[warn(dead_assignment)] on by default`

~~Note: Rebased on top of another PR. (uses other changes)~~

* [x] Implement read+write
* [x] Warn about misplaced options
* [x] Fix liveness (`dead_assignment` lint)
* [x] Add all tests
auto merge of #12855 : alexcrichton/rust/shutdown, r=brson

This is something that is plausibly useful, and is provided by libuv. This is
not currently surfaced as part of the `TcpStream` type, but it may possibly
appear in the future. For now only the raw functionality is provided through the
Rtio objects.
fix a test that was missed in the chan/port renaming (PR #12815)
auto merge of #12861 : huonw/rust/lint-owned-vecs, r=thestinger

lint: add lint for use of a `~[T]`.

This is useless at the moment (since pretty much every crate uses
`~[]`), but should help avoid regressions once completely removed from a
crate.