Skip to content

Commit

Permalink
runtime: update panic messages to include version (#3460)
Browse files Browse the repository at this point in the history
  • Loading branch information
Darksonn committed Jan 28, 2021
1 parent 62e24b7 commit 312c981
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
5 changes: 3 additions & 2 deletions tokio/src/io/driver/mod.rs
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tokio/src/runtime/handle.rs
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion tokio/src/sync/broadcast.rs
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion tokio/src/task/spawn.rs
Expand Up @@ -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)
}
Expand Down
5 changes: 3 additions & 2 deletions tokio/src/time/driver/handle.rs
Expand Up @@ -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
Expand Down

0 comments on commit 312c981

Please sign in to comment.