auto merge of #8554 : michaelwoerister/rust/generics, r=brson

This pull request includes support for generic functions and self arguments in methods, and combinations thereof. This also encompasses any kind of trait methods, regular and static, with and without default implementation. The implementation is backed up by a felt ton of test cases `:)`

This is a very important step towards being able to compile larger programs with debug info, since practically any generic function caused an ICE before.

One point worth discussing is that activating debug info now automatically (and silently) sets the `no_monomorphic_collapse` flag. Otherwise debug info would show wrong type names in all but one instance of the monomorphized function.

Another thing to note is that the handling of generic types does not strictly follow the DWARF specification. That is, variables with type `T` (where `T=int`) are described as having type `int` and not as having type `T`. In other words, we are losing information whether a variable has been declared with a type parameter as its type. In practice this should not make much of difference though since the concrete type is mostly what one is interested in. I'll post an issue later so this won't be forgotten.

Also included are a number of bug fixes:
* Closes #1758
* Closes #8513
* Closes #8443
* Fixes handling of field names in tuple structs
* Fixes and re-enables test case for option-like enums that relied on undefined behavior before
* Closes #1339 (should have been closed a while ago)

Cheers,
Michael
More spelling corrections.
Revert "Turn off jemalloc"

This reverts commit 371a316ec93a977f9dcd305b5f532cd394fa6885.

Closes #7217
auto merge of #8544 : dim-an/rust/fix-match-pipes, r=pcwalton

Pointers to bound variables shouldn't be stored before checking pattern,
otherwise piped patterns can conflict with each other (issue #6338).

Closes #6338.
extract_grammar symnames

add missing symnames

Signed-off-by: Jan Kobler <eng1@koblersystems.de>
auto merge of #8547 : kballard/rust/trait-parse-err-msg, r=alexcrichton

When parsing a trait function, the function must end with either `;` or
`{` (signifying a default implementation). The error message incorrectly
stated that it must be `;` or `}`.

Fixes #6610.
insert space

in the rust grammar

to avoid error messages like this:

  Exception: non-alpha apparent keyword: pub"

when using extract_grammar.py:

python2.7 src/etc/extract_grammar.py <doc/rust.md

Signed-off-by: Jan Kobler <eng1@koblersystems.de>
auto merge of #8550 : kballard/rust/token-start-err-msg, r=catamorphism

The span was fixed at some point to point to the correct character, but
the error message is still bad. Update it to emit the actual character
in question (potentially escaped).

Fixes #3747.
auto merge of #8551 : huonw/rust/speling, r=alexcrichton

(This doesn't add/remove `u`s or change `ize` to `ise`, or anything like that.)
auto merge of #8555 : chris-morgan/rust/time-clone, r=huonw

I need `Clone` for `Tm` for my latest work on [rust-http](https://github.com/chris-morgan/rust-http) (static typing for headers, and headers like `Date` are a time), so here it is.

@huonw recommended deriving DeepClone while I was at it.

I also had to implement `DeepClone` for `~str` to get a derived implementation of `DeepClone` for `Tm`; I did `@str` while I was at it, for consistency.
std::to_bytes: Delimit sequences &[A] and ~str when hashing

Address issue #5257, for example these values all had the same hash value:

	("aaa", "bbb", "ccc")
	("aaab", "bb", "ccc")
	("aaabbb", "", "ccc")

IterBytes for &[A] now includes the length, before calling iter_bytes on
each element.

IterBytes for &str is now terminated by a byte that does not appear in
UTF-8. This way only one more byte is processed when hashing strings.
std::to_bytes: Implement IterBytes on 1- to 8-tuples
std::hash: Add testcase for colliding hashes of tuples

Add a testcase that verifies that (s, t) and (u, v) don't collide even if
s + t == u + v (concatenation).
auto merge of #8558 : kballard/rust/xorshift-seed, r=cmr

Fixes #8359.
quote_*! macros take an ExtCtx

They previously required one called "ext_cx" to be in scope.

Fixes part of #7727
Fix ICE when calling static and static function pointers

Fixes #8588
Add assertions to test
auto merge of #8545 : blake2-ppc/rust/iterbytes, r=alexcrichton

Address issue #5257, for example these values all had the same hash value:

	("aaa", "bbb", "ccc")
	("aaab", "bb", "ccc")
	("aaabbb", "", "ccc")

IterBytes for &[A] now includes the length, before calling iter_bytes on
each element.

IterBytes for &str is now terminated by a byte that does not appear in
UTF-8. This way only one more byte is processed when hashing strings.
Fixed -Z print-link-args
Add assertions and cross crate tests