auto merge of #10986 : adridu59/rust/patch-new, r=alexcrichton

Thanks to @huonw for some mentoring. :cake:
Support ANSI colors in msys terminals. See #2807
std::vec: add a sugary .sort() method for plain Ord sorting.

This moves the custom sorting to `.sort_by`.
auto merge of #11077 : alexcrichton/rust/crate-id, r=cmr

Right now the --crate-id and related flags are all process *after* the entire
crate is parsed. This is less than desirable when used with makefiles because it
means that just to learn the output name of the crate you have to parse the
entire crate (unnecessary).

This commit changes the behavior to lift the handling of these flags much sooner
in the compilation process. This allows us to not have to parse the entire crate
and only have to worry about parsing the crate attributes themselves. The
related methods have all been updated to take an array of attributes rather than
a crate.

Additionally, this ceases duplication of the "what output are we producing"
logic in order to correctly handle things in the case of --test.

Finally, this adds tests for all of this functionality to ensure that it does
not regress.
auto merge of #11031 : jhasse/rust/patch-msys-3, r=cmr

Enable ANSI colors if TERM is set to cygwin and terminfo is not available (msys terminal on Windows). See #2807
Remove remainder field from MutChunkIter

This field is no longer necessary now that #9629 is fixed since we can just
access the length of the remaining slice directly.
Update next() and size_hint() for MutSpliterIterator

Update the next() method to just return self.v in the case that we've reached
the last element that the iterator will yield. This produces equivalent
behavior as before, but without the cost of updating the field.

Update the size_hint() method to return a better hint now that #9629 is fixed.
Implement size_hint() for ByRef iterator
mk: Work around problem with run-make tests on multiple targets. #11094
mk: Remove obsolete source reformatting rules
auto merge of #11079 : chris-morgan/rust/fix-11072-regressions, r=brson

(#11072)

There, concrete evidence that I shouldn't try doing such things at 1:30am.
auto merge of #10930 : DaGenix/rust/remove-unnecessary-fields, r=alexcrichton

3 minor clean-ups now that #9629 is fixed:

* Update MutChunkIter to remove the ```remainder``` that existed just to allow the size_hint() method to be implemented. This is no longer necessary since we can just access the length of the slice directly.
* Update MutSplitIterator to address the FIXME in its size_hint() method. This method was only partially implemented due to the issue. Also, implement a minor optimization in the case that its the last iteration.
* Update ByRef iterator to implement the size_hint() method.

I noticed that MutSplitIterator returns an empty slice if called on an empty slice. I don't know if this is intended or not, but I left the ```finished``` field in-place to preserve this behavior.

@TeXitoi @blake2-ppc
rustuv: Stop link to pthread on Windows
auto merge of #11100 : klutzy/rust/win-no-pthread-2, r=alexcrichton
Remove unnecessary semicolon
std: Remove some @-boxes
auto merge of #11095 : brson/rust/issue-11094, r=alexcrichton
Don't poison ARCs that are used while unwinding

Closes #11097
Remove unneccessary mut from arc
Attempt to fix the segfaulting osx bots

Upon inspecting the core dumps, they're all segfaulting at the same instruction
with the same value in a register that looks fishy. It appears to be indexing
into an array with a -1 index and then getting some weird overflow and dying.

I have attempted to fix this as part of
alexcrichton/libuv@fd5308383c575472edb2163d823dc6670bf59609,
but I am unsure of whether this is the actual cause of the problem, so I am not
going to upstream it just yet. I have a fairly high confidence that this is
indeed the problem, but I want to make sure that the bots to segfault all over
the place before upstreaming.