Fix range performance regression

A recent change to the implementation of range iterators meant that,
even when stepping by 1, the iterators *always* involved checked
arithmetic.

This commit reverts to the earlier behavior (while retaining the
refactoring into traits).

Fixes #24095
cc #24014
This commit is contained in:
Aaron Turon 2015-04-06 11:07:20 -07:00
parent 9f37ba64e8
commit dddcbcfeac
2 changed files with 24 additions and 24 deletions

View file

@ -19,6 +19,7 @@ pub fn main() {
for i in false..true {}
//~^ ERROR the trait
//~^^ ERROR the trait
//~^^^ ERROR the trait
// Unsized type.
let arr: &[_] = &[1, 2, 3];