auto merge of #6543 : catamorphism/rust/traits-cleanup, r=nikomatsakis

r? @nikomatsakis Impls can implement either zero or one traits; this has been true
more or less since we removed classes. So I got rid of the comments
saying "we should support multiple traits" and changed the code to
make it clear that we don't. This is just cleanup, and doesn't break
any existing tests.
rustc: One less bad copy
rustc: Remove import that is, indeed, not necessary
auto merge of #6545 : catamorphism/rust/unused-import, r=catamorphism
Add reverse_part, replace each_permutation, add tests
Ensure reverse_part does not access outside given vector
Update to modern rust
iter: add fold, sum and product
fix warnings
auto merge of #6544 : thestinger/rust/new_iter, r=nikomatsakis
Remove each_permutation_ref
Implement sin_cos method for float, f64 and f32
Fix AtomicLoad builder code
Update to new for-loop protocol
auto merge of #6523 : cmr/rust/faster_each_permutation, r=luqmana

Closes #5127
auto merge of #6546 : cmr/rust/warning, r=thestinger
Re-implement lint with less emphasis on item ids

This way it's much easier to add lints throughout compilation correctly, and
functions on impls can alter the way lints are emitted.
Optimize lint passes to perform far fewer allocations

Achieves ~3x speedup on lint passes for libcore
Change lints to indicate exactly where the level was set
auto merge of #6093 : alexcrichton/rust/issue-2647, r=thestinger

Closes #2647

This way it's much easier to add lints throughout compilation correctly, and
functions on impls can alter the way lints are emitted. This involved pretty much rewriting how lints are emitted. Beforehand, only items could alter the lint settings, so whenever a lint was added it had to be associated with whatever item id it was coming from. I removed this (possibly questionably) in favor of just specifying a span and a message when adding a lint. When lint checking comes around, it looks at all the lints and sees which node with attributes best encloses it and uses that level of linting. This means that all consumer code doesn't have to deal with what item things came from (especially because functions on impls aren't items). More details of this can be found in the code (and comments).

As a bonus, I managed to greatly simplify emission of lints in resolve.rs about unused imports. Now instead of it manually tracking what the lint level is, it's all moved over into the lint module (as is to be expected).