From 68a1605c19b07679b0e89e52c097528feaca8592 Mon Sep 17 00:00:00 2001 From: Paul Dicker Date: Sun, 23 Apr 2023 21:32:23 +0200 Subject: [PATCH] Prevent bench_year_flags_from_year from being optimized out --- benches/chrono.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benches/chrono.rs b/benches/chrono.rs index 246271b81d..216616b824 100644 --- a/benches/chrono.rs +++ b/benches/chrono.rs @@ -64,7 +64,7 @@ fn bench_year_flags_from_year(c: &mut Criterion) { c.bench_function("bench_year_flags_from_year", |b| { b.iter(|| { for year in -999i32..1000 { - __BenchYearFlags::from_year(year); + let _ = __BenchYearFlags::from_year(black_box(year)); } }) });