docs: add a missing panic scenario of time::advance (#7394)

This commit is contained in:
Qi
2025-06-18 20:25:12 +08:00
committed by GitHub
parent b926700065
commit 013f323def
+12 -2
View File
@@ -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
///