style: rust warning (#2776)

This commit is contained in:
LongYinan 2025-07-12 23:38:42 +08:00 committed by GitHub
parent 67449f1917
commit a30d42c624
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 4 deletions

View File

@ -1,4 +1,6 @@
use std::cell::{Cell, LazyCell, RefCell};
#[cfg(not(feature = "noop"))]
use std::cell::Cell;
use std::cell::{LazyCell, RefCell};
#[cfg(not(feature = "noop"))]
use std::collections::HashSet;
#[cfg(not(feature = "noop"))]
@ -8,8 +10,10 @@ use std::mem::MaybeUninit;
#[cfg(not(feature = "noop"))]
use std::ptr;
#[cfg(not(feature = "noop"))]
use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
use std::sync::{LazyLock, RwLock};
use std::sync::{
atomic::{AtomicBool, AtomicUsize, Ordering},
LazyLock, RwLock,
};
use std::{any::TypeId, collections::HashMap};
use rustc_hash::FxBuildHasher;

View File

@ -117,7 +117,7 @@ pub fn block_on<F: Future>(fut: F) -> F::Output {
/// Runs a future to completion
/// This is blocking, meaning that it pauses other execution until the future is complete,
/// only use it when it is absolutely necessary, in other places use async functions instead.
pub fn block_on<F: Future>(fut: F) -> F::Output {
pub fn block_on<F: Future>(_: F) -> F::Output {
unreachable!("noop feature is enabled, block_on is not available")
}