From 4620a1e8c5df63d52405fcf0c644b13329b79f73 Mon Sep 17 00:00:00 2001 From: Stepan Koltsov Date: Mon, 2 Oct 2023 03:51:41 +0100 Subject: [PATCH] Mute warnings --- test-crates/perftest/misc/src/bin/read_varint.rs | 6 +++--- test-crates/perftest/misc/src/lib.rs | 14 -------------- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/test-crates/perftest/misc/src/bin/read_varint.rs b/test-crates/perftest/misc/src/bin/read_varint.rs index 19c065de2..19c5b25db 100644 --- a/test-crates/perftest/misc/src/bin/read_varint.rs +++ b/test-crates/perftest/misc/src/bin/read_varint.rs @@ -1,10 +1,10 @@ use std::env; +use std::hint; use std::process; use std::time::Instant; use protobuf::CodedInputStream; use protobuf::CodedOutputStream; -use protobuf_perftest_misc::black_box; fn main() { let args: Vec = env::args().skip(1).collect(); @@ -42,9 +42,9 @@ fn main() { if i % br == 0 { eprintln!("{}", i / br); } - let mut is = CodedInputStream::from_bytes(black_box(&data)); + let mut is = CodedInputStream::from_bytes(hint::black_box(&data)); while !is.eof().unwrap() { - black_box(is.read_raw_varint64().unwrap()); + hint::black_box(is.read_raw_varint64().unwrap()); } } diff --git a/test-crates/perftest/misc/src/lib.rs b/test-crates/perftest/misc/src/lib.rs index 9042726c6..8b1378917 100644 --- a/test-crates/perftest/misc/src/lib.rs +++ b/test-crates/perftest/misc/src/lib.rs @@ -1,15 +1 @@ -// Feature name changed -#![cfg_attr(rustc_nightly, feature(bench_black_box))] -#![cfg_attr(rustc_nightly, feature(test))] -#[cfg(not(rustc_nightly))] -#[inline(never)] -pub fn black_box(v: T) -> T { - v -} - -#[cfg(rustc_nightly)] -#[inline(always)] -pub fn black_box(v: T) -> T { - std::hint::black_box(v) -}