Add test for #6155
rustc::typeck: fix array out of bounds

Fixes #6155
pass correct flags to jemalloc for cross-compiling
Mention `for` in the section on loops

The "4.3 Loops" section only describes `while` and `loop`. We then see `for`
used in a code sample at the end of the "13. Vectors and strings" section,
but it's explained for the first time only in the next section --
"14. Closures".

It is worth mentioning it in "4.3 Loops".
std: Change str::from_bytes to raise a condition on invalid input

As per #4765
auto merge of #7001 : alco/rust/tutorial-for-loop, r=bstrie

The "4.3 Loops" section only describes `while` and `loop`. We then see `for`
used in a code sample at the end of the "13. Vectors and strings" section,
but it's explained for the first time only in the next section --
"14. Closures".

It is worth mentioning it in "4.3 Loops".

---

Feel free to reword it and commit yourself if you don't like my wording.
A reminder that a block is a single expr in closures

This is something that's only been briefly mentioned in the beginning of
the tutorial and all of the closure examples within this subsection
include only one expression between { and }.
Avoid unnecessary (re-)allocations in the lexer
Avoid unnecessary heap allocations in the metadata ty decoder
tydecode: Accept a plain borrowed pointer to the data
Lexer: Avoid unnecessary allocations
TypeChecker: Avoid unnecessary copies
Remove some unnecessary closures
Lexer: Fix offset handling in get_str_from()

As the comment said, the subtraction is bogus for multibyte characters.
Fortunately, we can just use last_pos instead of pos to get the correct
position without any subtraction hackery.
Avoid unnecessary allocations in the metadata decoder
add the Iterator trait to the prelude
testsuite: Add test cases that pass
auto merge of #6695 : catamorphism/rust/moretestcases, r=catamorphism
auto merge of #6920 : catamorphism/rust/issue-4765, r=bstrie

r? anybody As per #4765
auto merge of #7000 : Blei/rust/fix-6155, r=catamorphism