@@ -182,7 +182,6 @@ impl Duration {
182
182
#[ inline]
183
183
#[ must_use]
184
184
#[ rustc_const_stable( feature = "duration_consts_2" , since = "1.58.0" ) ]
185
- #[ cfg_attr( bootstrap, rustc_allow_const_fn_unstable( const_panic) ) ]
186
185
pub const fn new ( secs : u64 , nanos : u32 ) -> Duration {
187
186
let secs = match secs. checked_add ( ( nanos / NANOS_PER_SEC ) as u64 ) {
188
187
Some ( secs) => secs,
@@ -482,7 +481,6 @@ impl Duration {
482
481
without modifying the original"]
483
482
#[ inline]
484
483
#[ rustc_const_stable( feature = "duration_consts_2" , since = "1.58.0" ) ]
485
- #[ cfg_attr( bootstrap, rustc_allow_const_fn_unstable( const_panic) ) ]
486
484
pub const fn checked_add ( self , rhs : Duration ) -> Option < Duration > {
487
485
if let Some ( mut secs) = self . secs . checked_add ( rhs. secs ) {
488
486
let mut nanos = self . nanos + rhs. nanos ;
@@ -543,7 +541,6 @@ impl Duration {
543
541
without modifying the original"]
544
542
#[ inline]
545
543
#[ rustc_const_stable( feature = "duration_consts_2" , since = "1.58.0" ) ]
546
- #[ cfg_attr( bootstrap, rustc_allow_const_fn_unstable( const_panic) ) ]
547
544
pub const fn checked_sub ( self , rhs : Duration ) -> Option < Duration > {
548
545
if let Some ( mut secs) = self . secs . checked_sub ( rhs. secs ) {
549
546
let nanos = if self . nanos >= rhs. nanos {
@@ -602,7 +599,6 @@ impl Duration {
602
599
without modifying the original"]
603
600
#[ inline]
604
601
#[ rustc_const_stable( feature = "duration_consts_2" , since = "1.58.0" ) ]
605
- #[ cfg_attr( bootstrap, rustc_allow_const_fn_unstable( const_panic) ) ]
606
602
pub const fn checked_mul ( self , rhs : u32 ) -> Option < Duration > {
607
603
// Multiply nanoseconds as u64, because it cannot overflow that way.
608
604
let total_nanos = self . nanos as u64 * rhs as u64 ;
@@ -660,7 +656,6 @@ impl Duration {
660
656
without modifying the original"]
661
657
#[ inline]
662
658
#[ rustc_const_stable( feature = "duration_consts_2" , since = "1.58.0" ) ]
663
- #[ cfg_attr( bootstrap, rustc_allow_const_fn_unstable( const_panic) ) ]
664
659
pub const fn checked_div ( self , rhs : u32 ) -> Option < Duration > {
665
660
if rhs != 0 {
666
661
let secs = self . secs / ( rhs as u64 ) ;
0 commit comments