File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ use crate::panic::{Location, PanicInfo};
36
36
#[ cfg_attr( not( feature = "panic_immediate_abort" ) , inline( never) ) ]
37
37
#[ cfg_attr( feature = "panic_immediate_abort" , inline) ]
38
38
#[ track_caller]
39
+ #[ rustc_const_unstable( feature = "core_panic" , issue = "none" ) ]
39
40
#[ lang = "panic" ] // needed by codegen for panic on overflow and other `Assert` MIR terminators
40
41
pub const fn panic ( expr : & ' static str ) -> ! {
41
42
// Use Arguments::new_v1 instead of format_args!("{}", expr) to potentially
Original file line number Diff line number Diff line change @@ -727,7 +727,7 @@ impl Duration {
727
727
pub const fn from_secs_f64 ( secs : f64 ) -> Duration {
728
728
match Duration :: try_from_secs_f64 ( secs) {
729
729
Ok ( v) => v,
730
- Err ( e) => crate :: panicking :: panic ( e. description ( ) ) ,
730
+ Err ( e) => panic ! ( "{}" , e. description( ) ) ,
731
731
}
732
732
}
733
733
@@ -788,7 +788,7 @@ impl Duration {
788
788
pub const fn from_secs_f32 ( secs : f32 ) -> Duration {
789
789
match Duration :: try_from_secs_f32 ( secs) {
790
790
Ok ( v) => v,
791
- Err ( e) => crate :: panicking :: panic ( e. description ( ) ) ,
791
+ Err ( e) => panic ! ( "{}" , e. description( ) ) ,
792
792
}
793
793
}
794
794
You can’t perform that action at this time.
0 commit comments