diff options
author | Avery Harnish <EverlastingBugstopper@users.noreply.github.com> | 2020-01-24 17:10:12 -0600 |
---|---|---|
committer | Carl Lerche <me@carllerche.com> | 2020-01-24 15:10:11 -0800 |
commit | 9eca96aa214cb8e2fd695cbed179f93826b3ef46 (patch) | |
tree | 4031da77db0864303e3b9887b7507d705a24e85c /tokio/src/time/driver | |
parent | a16c9a5a018af21ce48895207564a74c7feacc8b (diff) |
rt: improve "no runtime" panic messages (#2145)
Diffstat (limited to 'tokio/src/time/driver')
-rw-r--r-- | tokio/src/time/driver/handle.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tokio/src/time/driver/handle.rs b/tokio/src/time/driver/handle.rs index 3a424800..38b1761c 100644 --- a/tokio/src/time/driver/handle.rs +++ b/tokio/src/time/driver/handle.rs @@ -21,7 +21,8 @@ impl Handle { /// /// This function panics if there is no current timer set. pub(crate) fn current() -> Self { - context::time_handle().expect("no current timer") + context::time_handle() + .expect("there is no timer running, must be called from the context of Tokio runtime") } /// Tries to return a strong ref to the inner |