Add tests for E-needstest issues

Closes #7268.
Closes #10396.
Closes #10501.
Closes #11382.
Closes #11771.
Closes #12741.
Closes #13058.
Closes #15063.
Closes #15734.
Closes #16774.
Closes #18110.
This needs to be a run-pass test to check that the box is cleaned up only once.  It should also verify that the assignment worked.    The borrowck error can be avoided by limiting the scope of the closure:

```rust
fn main() {
    let mut test = box 5i;
    {
        let mut change = |&mut:| { *test = 10 };
        change();
    }
    assert_eq!(*test, 10);
}
```