mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-30 00:00:16 +02:00
runtime: update panic messages to include version (#3460)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user