summaryrefslogtreecommitdiffstats
path: root/tokio/src/runtime
diff options
context:
space:
mode:
authorAlice Ryhl <alice@ryhl.io>2020-10-02 00:01:11 +0200
committerGitHub <noreply@github.com>2020-10-02 01:01:11 +0300
commit13de30c53eb90a5453f1cecf47b188e254a293ac (patch)
tree802639b8458731ded87db53a8805364064c44c19 /tokio/src/runtime
parent496e8899172a39eb8b2cff0f2462141ddc6b575d (diff)
task: remove deprecated JoinError constructors (#2900)
Diffstat (limited to 'tokio/src/runtime')
-rw-r--r--tokio/src/runtime/task/error.rs16
-rw-r--r--tokio/src/runtime/task/harness.rs8
2 files changed, 6 insertions, 18 deletions
diff --git a/tokio/src/runtime/task/error.rs b/tokio/src/runtime/task/error.rs
index d5f65a49..dfdec44c 100644
--- a/tokio/src/runtime/task/error.rs
+++ b/tokio/src/runtime/task/error.rs
@@ -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)),
}
diff --git a/tokio/src/runtime/task/harness.rs b/tokio/src/runtime/task/harness.rs
index e86b29e6..208d48c4 100644
--- a/tokio/src/runtime/task/harness.rs
+++ b/tokio/src/runtime/task/harness.rs
@@ -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);
}
}