From 2bc8c547cdd9cd2e4f338477eea5860861879565 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Fri, 19 Apr 2019 09:06:08 +0200 Subject: [PATCH] move variable down to where it is used --- src/liballoc/collections/vec_deque.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/liballoc/collections/vec_deque.rs b/src/liballoc/collections/vec_deque.rs index 2ecc1df17de..d806bd0b1d7 100644 --- a/src/liballoc/collections/vec_deque.rs +++ b/src/liballoc/collections/vec_deque.rs @@ -3094,11 +3094,6 @@ mod tests { fn test_vec_from_vecdeque() { use crate::vec::Vec; - #[cfg(not(miri))] // Miri is too slow - let max_pwr = 7; - #[cfg(miri)] - let max_pwr = 5; - fn create_vec_and_test_convert(cap: usize, offset: usize, len: usize) { let mut vd = VecDeque::with_capacity(cap); for _ in 0..offset { @@ -3112,6 +3107,11 @@ mod tests { assert!(vec.into_iter().eq(vd)); } + #[cfg(not(miri))] // Miri is too slow + let max_pwr = 7; + #[cfg(miri)] + let max_pwr = 5; + for cap_pwr in 0..max_pwr { // Make capacity as a (2^x)-1, so that the ring size is 2^x let cap = (2i32.pow(cap_pwr) - 1) as usize;