mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-21 00:00:10 +02:00
task: remove deprecated JoinError constructors (#2900)
This commit is contained in:
@@ -16,25 +16,13 @@ enum Repr {
|
||||
}
|
||||
|
||||
impl JoinError {
|
||||
#[doc(hidden)]
|
||||
#[deprecated]
|
||||
pub fn cancelled() -> JoinError {
|
||||
Self::cancelled2()
|
||||
}
|
||||
|
||||
pub(crate) fn cancelled2() -> JoinError {
|
||||
pub(crate) fn cancelled() -> JoinError {
|
||||
JoinError {
|
||||
repr: Repr::Cancelled,
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
#[deprecated]
|
||||
pub fn panic(err: Box<dyn Any + Send + 'static>) -> JoinError {
|
||||
Self::panic2(err)
|
||||
}
|
||||
|
||||
pub(crate) fn panic2(err: Box<dyn Any + Send + 'static>) -> JoinError {
|
||||
pub(crate) fn panic(err: Box<dyn Any + Send + 'static>) -> JoinError {
|
||||
JoinError {
|
||||
repr: Repr::Panic(Mutex::new(err)),
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ where
|
||||
// If the task is cancelled, avoid polling it, instead signalling it
|
||||
// is complete.
|
||||
if snapshot.is_cancelled() {
|
||||
Poll::Ready(Err(JoinError::cancelled2()))
|
||||
Poll::Ready(Err(JoinError::cancelled()))
|
||||
} else {
|
||||
let res = guard.core.poll(self.header());
|
||||
|
||||
@@ -132,7 +132,7 @@ where
|
||||
}
|
||||
}
|
||||
Err(err) => {
|
||||
self.complete(Err(JoinError::panic2(err)), snapshot.is_join_interested());
|
||||
self.complete(Err(JoinError::panic(err)), snapshot.is_join_interested());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -297,9 +297,9 @@ where
|
||||
// Dropping the future panicked, complete the join
|
||||
// handle with the panic to avoid dropping the panic
|
||||
// on the ground.
|
||||
self.complete(Err(JoinError::panic2(err)), true);
|
||||
self.complete(Err(JoinError::panic(err)), true);
|
||||
} else {
|
||||
self.complete(Err(JoinError::cancelled2()), true);
|
||||
self.complete(Err(JoinError::cancelled()), true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user