Skip to content

Commit 2aca697

Browse files
authored
add panics section to method docs
1 parent 9e78cb2 commit 2aca697

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/libcore/time.rs

+9
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,9 @@ impl Duration {
480480

481481
/// Creates a new `Duration` from the specified number of seconds.
482482
///
483+
/// # Panics
484+
/// This constructor will panic if `secs` is not finite, negative or overflows `Duration`.
485+
///
483486
/// # Examples
484487
/// ```
485488
/// #![feature(duration_float)]
@@ -510,6 +513,9 @@ impl Duration {
510513

511514
/// Multiply `Duration` by `f64`.
512515
///
516+
/// # Panics
517+
/// This method will panic if result is not finite, negative or overflows `Duration`.
518+
///
513519
/// # Examples
514520
/// ```
515521
/// #![feature(duration_float)]
@@ -527,6 +533,9 @@ impl Duration {
527533

528534
/// Divide `Duration` by `f64`.
529535
///
536+
/// # Panics
537+
/// This method will panic if result is not finite, negative or overflows `Duration`.
538+
///
530539
/// # Examples
531540
/// ```
532541
/// #![feature(duration_float)]

0 commit comments

Comments
 (0)