Replace "ignore-win32" in tests with "ignore-windows"
auto merge of #16425 : nham/rust/fix_nan_format, r=alexcrichton

Currently, this:

    println!("{}", std::f64::NAN);

prints "-NaN". This commit is an attempt to change that to "NaN" instead.
auto merge of #16434 : vadimcn/rust/many-crates-but-no-match, r=alexcrichton
~ -> Box in the manual

Fixes #16439
libsyntax: Don't strip types and lifetimes from single-segment paths in
patterns.

This breaks code like:

    fn main() {
        match Some("foo") {
            None::<int> => {}
            Some(_) => {}
        }
    }

Change this code to not contain a type error. For example:

    fn main() {
        match Some("foo") {
            None::<&str> => {}
            Some(_) => {}
        }
    }

Closes #16353.

[breaking-change]
auto merge of #16081 : luqmana/rust/nr, r=pcwalton

Fixes #15763
guide-unsafe.md: fix wording

Following a suggestion by Huon Wilson.
Guide: patterns.

Fixes #4417.
auto merge of #16454 : pcwalton/rust/types-in-path-patterns, r=brson

patterns.

This breaks code like:

    fn main() {
        match Some("foo") {
            None::<int> => {}
            Some(_) => {}
        }
    }

Change this code to not contain a type error. For example:

    fn main() {
        match Some("foo") {
            None::<&str> => {}
            Some(_) => {}
        }
    }

Closes #16353.

[breaking-change]

r? @huonw
Enable deprecation lint on crate-local items

Previously the lint considered cross-crate items only. That's
appropriate for unstable and experimental levels, but not for
deprecation.

Closes #16409

Due to deny(deprecation), this is a:

[breaking-change]
Deprecation fallout in libcollections
Deprecation fallout in libsync
Allow deprecation in deprecated libraries
librustc: Record unique immutable borrows in the restrictions table.

This fixes borrow checking for closures. Code like this will break:

    struct Foo {
        x: int,
    }

    pub fn main() {
        let mut this = &mut Foo {
            x: 1,
        };
        let r = || {
            let p = &this.x;
            &mut this.x;
        };
        r()
    }

Change this code to not take multiple mutable references to the same value. For
example:

    struct Foo {
        x: int,
    }

    pub fn main() {
        let mut this = &mut Foo {
            x: 1,
        };
        let r = || {
            &mut this.x;
        };
        r()
    }

Closes #16361.

[breaking-change]
auto merge of #16433 : aturon/rust/deprecated-in-crate, r=alexcrichton

Previously the stability lint considered cross-crate items only. That's appropriate for unstable and experimental levels, but not for deprecation.

In addition to changing the lint, this PR takes care of the fallout: a number of deprecated items that were being used throughout libstd.

Closes #16409

Due to deny(deprecated), this is a:

[breaking-change]
librustc: Use the correct categorized mutable type for the pattern in
`for` loop heads.

This breaks code like:

    let x = Some(box 1i);
        for &a in x.iter() {
    }

Change this code to obey the borrow checking rules. For example:

    let x = Some(box 1i);
        for &ref a in x.iter() {
    }

Closes #16205.

[breaking-change]
Revert "don't translate items when monomorphizing foreign-ABI functions"

This reverts commit 0c158b4fbfcec7d6f18859661047dff2109fdfe4.
Revert "avoid redundant translation of items during monomorphization"

This reverts commit f97f65f7b70e455c1c3e72e620120c9f1a96d89a.

Conflicts:
	src/librustc/middle/trans/base.rs
	src/librustc/middle/trans/foreign.rs
	src/librustc/middle/trans/monomorphize.rs
more consistent handling of inner items
auto merge of #16452 : epdtry/rust/unreachable-item-ice, r=pcwalton

This code produces an ICE:

```rust
#![crate_type = "rlib"]
fn main() {
    if true { return }
    // remaining code is unreachable
    match () {
        () => { static MAGIC: uint = 0; }
    }
}
```
([playpen](http://is.gd/iwOISB))

The error is "encode_symbol: id not found 18", where 18 is the `NodeId` of the declaration of `MAGIC`.  The problem is that `rustc` tries to emit metadata for `MAGIC`, but some of the information is missing because `MAGIC` never gets translated by `trans_item` - the entire body of the `match` gets skipped because the `match` itself is unreachable.

This branch simplifies the handling of inner items by always processing them using the `trans_item` visitor, instead of sometimes using the visitor and sometimes waiting until `trans_stmt` encounters the item.  This fixes the ICE by making the translation of the item no longer depend on the declaration being reachable code.  This branch also reverts #16059 and #16359, since the new change to item translation fixes the same problems as those but is simpler.