Reword &str coercion into viewing
auto merge of #18556 : seanmonstar/rust/tm-fmt, r=alexcrichton

The internals of strftime were converted to use a single formatter,
instead of creating and concatenating a bunch of small strings. This
showed ~3x improvement in the benches.

Also, since the formatted time may be going straight to a Writer, TmFmt
was introduced, and is returned from all formatting methods on Tm. This
allows the saving of another string allocation. Anyone wanting a String
can just call .to_string() on the returned value.

This runs validation prior to return the created `TmFmt`, catching errors before formatting happens. The specialized formats skip this validation, since we already know they are valid.

[breaking-change]
auto merge of #18634 : alexcrichton/rust/cfg-attr-crate-level, r=sfackler

This commit implements processing these two attributes at the crate level as
well as at the item level. When #[cfg] is applied at the crate level, then the
entire crate will be omitted if the cfg doesn't match. The #[cfg_attr] attribute
is processed as usual in that the attribute is included or not depending on
whether the cfg matches.

This was spurred on by motivations of #18585 where #[cfg_attr] annotations will
be applied at the crate-level.

cc #18585
auto merge of #18731 : chris-morgan/rust/derive-Clone-for-TypeId, r=alexcrichton
Renamed Extendable to Extend

In order to upgrade, simply rename the Extendable trait to Extend in
your code

Part of #18424

[breaking-change]
Implements Extend for EnumSet and LruCache

Part of #18424
auto merge of #18735 : utkarshkukreti/rust/remove-unnecessary-to_string-from-vec-docs, r=huonw

I don't think they're needed.
auto merge of #18740 : jbcrail/rust/implement-enum-set-len, r=alexcrichton

This commit adds the missing EnumSet method mentioned by @Gankro.

cc #18424
Fix handling of for loop patterns in regionck

When establishing region links within a pattern, use the mem-cat
of the type the pattern matches against (that is, the result
of `iter.next()`) rather than that of the iterator type.

Closes #17068
Closes #18767
Add regression for #17068
Add regression for #18767
mk: Fix Windows cross-build prefix
auto merge of #18475 : gamazeps/rust/toExtend, r=alexcrichton

Ensured that Extend & FromIterator are implemented for the libcollection.

Removed the fact that FromIterator had to be implemented in order to implement Extend, as it did not make sense for LruCache (it needs to be given a size and there are no Default for LruCache).

Changed the name from Extend to Extendable.

Part of #18424
auto merge of #18730 : bkoropoff/rust/issue-18652, r=eddyb

`FnOnce` environments that fit within an `int` are passed to the closure by value.  For some reason there was an assert that this would only happen if there were 1 or 0 free variables, but it can also happen if there are multiple variables that happen to fit.

Closes #18652
As of 4.9.2, gcc started passing -fno-lto to collect2, or to ld if collect2 cannot be found.  The latter is the case for our bundles, because we don't include collect2.  Unfortunately, ld does not understand this option and errors out.
On the bright side, -fno-use-linker-plugin still works to suppress gcc's LTO, so we can drop -fno-lto.
Move gcc back to rustlib\<triple>\bin
Prefer bundled linker.
Make Int inherit from Ord.

Previously Int inherited from PartialOrd (via Primitive)
but not Ord.  But integers have a total order, so
inheriting from Ord is appropriate. Fixes #18776.
Include some of the more popular Windows import libs into the bundle.
auto merge of #18743 : nikomatsakis/rust/hrtb-refactor-2, r=pcwalton

Various miscellaneous changes pushing towards HRTB support:

1. Update parser and adjust ast to support `for<'a,'b>` syntax, both in closures and trait bounds. Warn on the old syntax (not error, for stage0).
2. Refactor TyTrait representation to include a TraitRef.
3. Purge `once_fns` feature gate and `once` keyword.

r? @pcwalton 

This is a [breaking-change]:

- The `once_fns` feature is now officially deprecated. Rewrite using normal closures or unboxed closures.
- The new `for`-based syntax now issues warnings (but not yet errors):
  - `fn<'a>(T) -> U` becomes `for<'a> fn(T) -> U`
  - `<'a> |T| -> U` becomes `for<'a> |T| -> U`