debuginfo: Properly support by-value self arguments
debuginfo: Updated test cases to also test by-value self arguments.
llvm: Disable pthread on mingw

llvm supports both win32 native threads and pthread,
but configure tries to find pthread first.
This manually disables pthread to use native api.

This removes libpthreads-2.dll dependency on librustc.
mklldeps.py: Write to file instead of print

It seems that msys automatically converts `\n` to `\r\n` on pipe
redirection, which causes `make tidy` failure.
rustc: Allow `return` to return from a closure.

With the old `for` gone, this behaviour is no longer conflicting with
that use of `return` in closures, and this allows shortcircuiting in a
closure.
auto merge of #11024 : huonw/rust/return-from-closures, r=alexcrichton

With the old `for` gone, this behaviour is no longer conflicting with
that use of `return` in closures, and this allows shortcircuiting in a
closure.
auto merge of #11033 : michaelwoerister/rust/byvalself, r=pcwalton

As the title says. The trans changes will lead to an auxiliary alloca being created that allows debug info to track the `self` argument. This alloca is only created in debug builds however. Otherwise very little had to be done after I managed to navigate to some degree the jungle that is self-argument handling `:P` 

Closes #10549
Adding tests for closed issues

Closes #5806
Closes #5950
Closes #7178
Closes #8259
Closes #8578
Closes #8851
Closes #9129
Closes #10412
auto merge of #11012 : alexcrichton/rust/needstest, r=alexcrichton

Closes #5806
Closes #8259
Closes #8578
Closes #8851
Closes #10412
auto merge of #11013 : klutzy/rust/win-no-pthread, r=alexcrichton

llvm supports both win32 native threads and pthread,
but configure tries to find pthread first.
This manually disables pthread to use native api.

This removes libpthreads-2.dll dependency on librustc.
Make CFG_LIBDIR configurable. Fixes #5223