runtime: update panic messages to include version (#3460)

This commit is contained in:
Alice Ryhl
2021-01-28 14:39:15 +01:00
committed by GitHub
parent 62e24b710c
commit 312c981e3f
5 changed files with 8 additions and 7 deletions
+3 -2
View File
@@ -200,8 +200,9 @@ impl Handle {
///
/// This function panics if there is no current reactor set.
pub(super) fn current() -> Self {
context::io_handle()
.expect("there is no reactor running, must be called from the context of Tokio runtime")
context::io_handle().expect(
"there is no reactor running, must be called from the context of a Tokio 0.2.x runtime",
)
}
/// Forces a reactor blocked in a call to `turn` to wakeup, or otherwise
+1 -1
View File
@@ -115,7 +115,7 @@ impl Handle {
/// # }
/// ```
pub fn current() -> Self {
context::current().expect("not currently running on the Tokio runtime.")
context::current().expect("not currently running on a Tokio 0.2.x runtime.")
}
/// Returns a Handle view over the currently running Runtime
-1
View File
@@ -957,7 +957,6 @@ where
#[cfg(feature = "stream")]
#[doc(hidden)]
#[deprecated(since = "0.2.21", note = "use `into_stream()`")]
impl<T> crate::stream::Stream for Receiver<T>
where
T: Clone,
+1 -1
View File
@@ -128,7 +128,7 @@ doc_rt_core! {
T::Output: Send + 'static,
{
let spawn_handle = runtime::context::spawn_handle()
.expect("must be called from the context of Tokio runtime configured with either `basic_scheduler` or `threaded_scheduler`");
.expect("must be called from the context of a Tokio 0.2.x runtime configured with either `basic_scheduler` or `threaded_scheduler`");
let task = crate::util::trace::task(task, "task");
spawn_handle.spawn(task)
}
+3 -2
View File
@@ -21,8 +21,9 @@ impl Handle {
///
/// This function panics if there is no current timer set.
pub(crate) fn current() -> Self {
context::time_handle()
.expect("there is no timer running, must be called from the context of Tokio runtime")
context::time_handle().expect(
"there is no timer running, must be called from the context of a Tokio 0.2.x runtime",
)
}
/// Tries to return a strong ref to the inner