mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-21 00:00:10 +02:00
docs: add a missing panic scenario of time::advance (#7394)
This commit is contained in:
+12
-2
@@ -185,8 +185,18 @@ cfg_test_util! {
|
||||
///
|
||||
/// # Panics
|
||||
///
|
||||
/// Panics if time is not frozen or if called from outside of the Tokio
|
||||
/// runtime.
|
||||
/// Panics if any of the following conditions are met:
|
||||
///
|
||||
/// - The clock is not frozen, which means that you must
|
||||
/// call [`pause`] before calling this method.
|
||||
/// - If called outside of the Tokio runtime.
|
||||
/// - If the input `duration` is too large (such as [`Duration::MAX`])
|
||||
/// to be safely added to the current time without causing an overflow.
|
||||
///
|
||||
/// # Caveats
|
||||
///
|
||||
/// Using a very large `duration` is not recommended,
|
||||
/// as it may cause panicking due to overflow.
|
||||
///
|
||||
/// # Auto-advance
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user