Skip to content

Commit cd47cf9

Browse files
committed
rollup merge of #21865: steveklabnik/gh21501
Fixes #21501 r? @huonw
2 parents 87eb67f + 4197e5f commit cd47cf9

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/doc/trpl/testing.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -552,9 +552,7 @@ extern crate test;
552552
# struct X;
553553
# impl X { fn iter<T, F>(&self, _: F) where F: FnMut() -> T {} } let b = X;
554554
b.iter(|| {
555-
let mut n = 1000_u32;
556-
557-
test::black_box(&mut n); // pretend to modify `n`
555+
let n = test::black_box(1000);
558556

559557
range(0, n).fold(0, |a, b| a ^ b)
560558
})
@@ -569,7 +567,7 @@ Performing either of the above changes gives the following benchmarking results
569567

570568
```text
571569
running 1 test
572-
test bench_xor_1000_ints ... bench: 1 ns/iter (+/- 0)
570+
test bench_xor_1000_ints ... bench: 131 ns/iter (+/- 3)
573571
574572
test result: ok. 0 passed; 0 failed; 0 ignored; 1 measured
575573
```

0 commit comments

Comments
 (0)