diff --git a/src/rustup-utils/src/lib.rs b/src/rustup-utils/src/lib.rs index 33a3b1b06a..987caaab19 100644 --- a/src/rustup-utils/src/lib.rs +++ b/src/rustup-utils/src/lib.rs @@ -1,6 +1,5 @@ #![feature(core_intrinsics)] // For type_name(). #![feature(fundamental)] -#![feature(step_by)] #![recursion_limit = "1024"] // for error_chain! extern crate hyper; diff --git a/src/rustup-utils/src/sha2.rs b/src/rustup-utils/src/sha2.rs index 1b1b6877ac..b812407dcd 100644 --- a/src/rustup-utils/src/sha2.rs +++ b/src/rustup-utils/src/sha2.rs @@ -361,7 +361,8 @@ impl Engine256State { // Putting the message schedule inside the same loop as the round calculations allows for // the compiler to generate better code. - for t in (0..48).step_by(8) { + let mut t = 0; + while t < 48 { schedule_round!(t + 16); schedule_round!(t + 17); schedule_round!(t + 18); @@ -379,9 +380,12 @@ impl Engine256State { sha2_round!(d, e, f, g, h, a, b, c, K32, t + 5); sha2_round!(c, d, e, f, g, h, a, b, K32, t + 6); sha2_round!(b, c, d, e, f, g, h, a, K32, t + 7); + + t += 8; } - for t in (48..64).step_by(8) { + let mut t = 48; + while t < 64 { sha2_round!(a, b, c, d, e, f, g, h, K32, t); sha2_round!(h, a, b, c, d, e, f, g, K32, t + 1); sha2_round!(g, h, a, b, c, d, e, f, K32, t + 2); @@ -390,6 +394,8 @@ impl Engine256State { sha2_round!(d, e, f, g, h, a, b, c, K32, t + 5); sha2_round!(c, d, e, f, g, h, a, b, K32, t + 6); sha2_round!(b, c, d, e, f, g, h, a, K32, t + 7); + + t += 8; } self.h0 = self.h0.wrapping_add(a);