chore: Prepare for Rust edition bump to 2024 (without autofix) (#27791)
Successor to #27779 - in this PR I've applied changes manually, without futzing with if let lifetimes at all. Release Notes: - N/A
This commit is contained in:
parent
d51aa2ffb0
commit
0729d24d77
162 changed files with 2333 additions and 1937 deletions
|
@ -196,12 +196,12 @@ impl BackgroundExecutor {
|
|||
}
|
||||
|
||||
#[cfg(not(any(test, feature = "test-support")))]
|
||||
pub(crate) fn block_internal<R>(
|
||||
pub(crate) fn block_internal<Fut: Future>(
|
||||
&self,
|
||||
_background_only: bool,
|
||||
future: impl Future<Output = R>,
|
||||
future: Fut,
|
||||
timeout: Option<Duration>,
|
||||
) -> Result<R, impl Future<Output = R>> {
|
||||
) -> Result<Fut::Output, impl Future<Output = Fut::Output> + use<Fut>> {
|
||||
use std::time::Instant;
|
||||
|
||||
let mut future = Box::pin(future);
|
||||
|
@ -234,12 +234,12 @@ impl BackgroundExecutor {
|
|||
|
||||
#[cfg(any(test, feature = "test-support"))]
|
||||
#[track_caller]
|
||||
pub(crate) fn block_internal<R>(
|
||||
pub(crate) fn block_internal<Fut: Future>(
|
||||
&self,
|
||||
background_only: bool,
|
||||
future: impl Future<Output = R>,
|
||||
future: Fut,
|
||||
timeout: Option<Duration>,
|
||||
) -> Result<R, impl Future<Output = R>> {
|
||||
) -> Result<Fut::Output, impl Future<Output = Fut::Output> + use<Fut>> {
|
||||
use std::sync::atomic::AtomicBool;
|
||||
|
||||
let mut future = Box::pin(future);
|
||||
|
@ -291,8 +291,8 @@ impl BackgroundExecutor {
|
|||
waiting_message = format!("\n waiting on: {}\n", waiting_hint);
|
||||
}
|
||||
panic!(
|
||||
"parked with nothing left to run{waiting_message}{backtrace_message}",
|
||||
)
|
||||
"parked with nothing left to run{waiting_message}{backtrace_message}",
|
||||
)
|
||||
}
|
||||
self.dispatcher.park(None);
|
||||
}
|
||||
|
@ -303,11 +303,11 @@ impl BackgroundExecutor {
|
|||
|
||||
/// Block the current thread until the given future resolves
|
||||
/// or `duration` has elapsed.
|
||||
pub fn block_with_timeout<R>(
|
||||
pub fn block_with_timeout<Fut: Future>(
|
||||
&self,
|
||||
duration: Duration,
|
||||
future: impl Future<Output = R>,
|
||||
) -> Result<R, impl Future<Output = R>> {
|
||||
future: Fut,
|
||||
) -> Result<Fut::Output, impl Future<Output = Fut::Output> + use<Fut>> {
|
||||
self.block_internal(true, future, Some(duration))
|
||||
}
|
||||
|
||||
|
@ -365,7 +365,7 @@ impl BackgroundExecutor {
|
|||
|
||||
/// in tests, run an arbitrary number of tasks (determined by the SEED environment variable)
|
||||
#[cfg(any(test, feature = "test-support"))]
|
||||
pub fn simulate_random_delay(&self) -> impl Future<Output = ()> {
|
||||
pub fn simulate_random_delay(&self) -> impl Future<Output = ()> + use<> {
|
||||
self.dispatcher.as_test().unwrap().simulate_random_delay()
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue