]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #47180 - varkor:range-iterator-overrides, r=alexcrichton
authorbors <bors@rust-lang.org>
Thu, 11 Jan 2018 12:22:54 +0000 (12:22 +0000)
committerbors <bors@rust-lang.org>
Thu, 11 Jan 2018 12:22:54 +0000 (12:22 +0000)
Add iterator method specialisations to Range*

Add specialised implementations of `max` for `Range`, and `last`, `min` and `max` for `RangeInclusive`, all of which lead to significant advantages in the generated assembly on x86.

Note that adding specialisations of `min` and `last` for `Range` led to no benefit, and adding `sum` for `Range` and `RangeInclusive` led to type inference issues (though this is possibly still worthwhile considering the performance gain).

This addresses some of the concerns in #39975.


Trivial merge