auto merge of #13799 : m-r-r/rust/patch-std-io-standard_error, r=alexcrichton

Hello,

With the latest version of Rust, calling to the function [`std::io::standard_error()`](http://static.rust-lang.org/doc/master/std/io/fn.standard_error.html) succeeds only if the value of the argument is `EndOfFile`, `IoUnavailable` or `InvalidInput`. If the function is called with another value as argument, it fails without message.

Here is a piece of code that reproduces the problem:

```rust
use std::io::{standard_error,EndOfFile,FileNotFound,PermissionDenied};

fn main() {
     println!("Error 1: {}", standard_error(EndOfFile)); // does not fail
     println!("Error 2: {}", standard_error(FileNotFound)); // fails
     println!("Error 3: {}", standard_error(PermissionDenied)); //fails
}
```
This was because the `IoErrorKind` passed as argument wasn't matched against all the possible values.

I added the missing branches in the `match` statement inside the function, and i removed the call to the `fail!()` macro. I rebuilt the crate with the latest `rustc` version and it seems to works.
auto merge of #13801 : ryantm/rust/master, r=alexcrichton

The previous error message using assert_eq! was quite cryptic. This should be more clear. I also added a test for the underflow case.
std: Rewrite crate docs

Also move prelude explanation to the prelude module.
auto merge of #13809 : prattmic/rust/tutorial_debug, r=alexcrichton

As of cc6ec8df, the Owned closures example uses println! instead of
debug!, making a note about seeing debug seem out-of-place in this
section.

Since debug! is not used elsewhere in the tutorial, remove the note
entirely.
Fix repeated module documentation
test: Fix run-make on windows
auto merge of #13795 : klutzy/rust/win-make-check, r=alexcrichton

Fixes #12303.

Also contains a partial fix for `make check` failure.
test: Add tests for closed issues

Closes #5518
Closes #7320
Closes #8391
Closes #8827
Closes #8983
Closes #10683
Closes #10802
Closes #11515
auto merge of #13811 : alexcrichton/rust/closed-issues, r=sfackler

Closes #5518
Closes #7320
Closes #8391
Closes #8827
Closes #8983
Closes #10683
Closes #10802
Closes #11515
Refactor ty_str to use a ~(str) representation.

Similar to my recent changes to ~[T]/&[T], these changes remove the vstore abstraction and represent str types as ~(str) and &(str). The Option<uint> in ty_str is the length of the string, None if the string is dynamically sized.
auto merge of #13791 : lifthrasiir/rust/mod-inner-span, r=huonw

This PR is primarily motivated by (and fixes) #12926.

We currently only have a span for the individual item itself and not for the referred contents. This normally does not cause a problem since both are located in the same file; it *is* possible that the contained statement or item is located in the other file (the syntax extension can do that), but even in that case the syntax extension should be located in the same file as the item. The module item (i.e. `mod foo;`) is the only exception here, and thus warrants a special treatment.

Rustdoc would now distinguish `mod foo;` from `mod foo {...}` by checking if the span for the module item and module contents is in different files. If it's the case, we'd prefer module contents over module item. There are alternative strategies, but as noted above we will have some corner cases if we don't record the contents span explicitly.
Remove default method implementations
std: Add more docs to `std::mem::replace`.
Fixed typo in std::vec
auto merge of #13821 : aochagavia/rust/pr3, r=alexcrichton
rustdoc: fix a few inconsistencies
auto merge of #13797 : lifthrasiir/rust/std-mem-replace-doc, r=alexcrichton

Inspired by @steveklabnik's [comment](http://www.reddit.com/r/rust/comments/240p9s/eli5_stdmemreplace/ch2gxw8), this PR adds the practical use cases to the documentation of `std::mem::replace`.

Caveat: We need a `compile-fail` equivalent for doctest. :p
rustdoc: Make strip_hidden use a dedicated hidden item if any.

fixes #13806.
auto merge of #13812 : alxgnon/rust/master, r=alexcrichton

This is a quick fix for repeated documentation descriptions in certain modules.
Following is a list of the faulty modules I found. I ran `pcregrep -r -M "<p>(.+)\n\1" doc` on the html documentation to help identify them.

- [rustuv::uvio](http://static.rust-lang.org/doc/master/rustuv/uvio/index.html)
- [rustuv::uvll](http://static.rust-lang.org/doc/master/rustuv/uvll/index.html)
- [std::rt::backtrace](http://static.rust-lang.org/doc/master/std/rt/backtrace/index.html)
- [std::rt::env](http://static.rust-lang.org/doc/master/std/rt/env/index.html)
- [std::rt::global_heap](http://static.rust-lang.org/doc/master/std/rt/global_heap/index.html)
- [std::rt::local_heap](http://static.rust-lang.org/doc/master/std/rt/local_heap/index.html)
- [std::rt::rtio](http://static.rust-lang.org/doc/master/std/rt/rtio/index.html)
- [std::rt::task](http://static.rust-lang.org/doc/master/std/rt/task/index.html)
- [std::rt::thread](http://static.rust-lang.org/doc/master/std/rt/thread/index.html)
- [std::rt::unwind](http://static.rust-lang.org/doc/master/std/rt/unwind/index.html)
- [syntax::parse::classify](http://static.rust-lang.org/doc/master/syntax/parse/classify/index.html)
- [syntax::parse::common](http://static.rust-lang.org/doc/master/syntax/parse/common/index.html)

After a little testing, I discovered that moving the documentation inside (`//!`) instead of outside (`///`) modules fixed the immediate problem. I went through the trouble of moving the documentation, and with this commit there are no more repeated descriptions within those faulty modules.

This does not fix the underlying problem though. We should look into why having the documentation outside instead of inside caused the descriptions to be repeated. I will create a separate issue with my findings on the subject if necessary.
In the meantime, this simple fix should be enough.
rustc: Pass -dead_strip on OSX

This flag to the linker asks it to strip away all dead code during linking, as
well as dead data. This reduces the size of hello world from 1.7MB to 458K on my
system (70% reduction).

I have not seen this impact link times negatively, and I have seen this pass
'make check' successfully. I am slightly wary of adding this option, but the
benefits are so huge tha I think we should work hard to work around any issues
rather than avoid using the flag entirely.