Merge pull request #1273 from waywardmonkeys/blackbox-criterion

Use std::hint::black_box consistently.
This commit is contained in:
Sébastien Crozet 2023-09-30 18:20:09 +02:00 committed by GitHub
commit d2d2571590
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 3 deletions

View File

@ -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);
}
})
});

View File

@ -1,4 +1,3 @@
#![feature(bench_black_box)]
#![allow(unused_macros)]
extern crate nalgebra as na;