Merge pull request #1273 from waywardmonkeys/blackbox-criterion
Use std::hint::black_box consistently.
This commit is contained in:
commit
d2d2571590
|
@ -142,7 +142,7 @@ fn iter(bench: &mut criterion::Criterion) {
|
|||
bench.bench_function("iter", move |bh| {
|
||||
bh.iter(|| {
|
||||
for value in a.iter() {
|
||||
criterion::black_box(value);
|
||||
std::hint::black_box(value);
|
||||
}
|
||||
})
|
||||
});
|
||||
|
@ -154,7 +154,7 @@ fn iter_rev(bench: &mut criterion::Criterion) {
|
|||
bench.bench_function("iter_rev", move |bh| {
|
||||
bh.iter(|| {
|
||||
for value in a.iter().rev() {
|
||||
criterion::black_box(value);
|
||||
std::hint::black_box(value);
|
||||
}
|
||||
})
|
||||
});
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
#![feature(bench_black_box)]
|
||||
#![allow(unused_macros)]
|
||||
|
||||
extern crate nalgebra as na;
|
||||
|
|
Loading…
Reference in New Issue