@@ -39,12 +39,7 @@ use crate::panic::{Location, PanicInfo};
39
39
#[ lang = "panic" ] // needed by codegen for panic on overflow and other `Assert` MIR terminators
40
40
pub fn panic ( expr : & str ) -> ! {
41
41
if cfg ! ( feature = "panic_immediate_abort" ) {
42
- // remove `unsafe` (and safety comment) on bootstrap bump
43
- #[ cfg_attr( not( bootstrap) , allow( unused_unsafe) ) ]
44
- // SAFETY: the `abort` intrinsic has no requirements to be called.
45
- unsafe {
46
- super :: intrinsics:: abort ( )
47
- }
42
+ super :: intrinsics:: abort ( )
48
43
}
49
44
50
45
// Use Arguments::new_v1 instead of format_args!("{}", expr) to potentially
@@ -62,12 +57,7 @@ pub fn panic(expr: &str) -> ! {
62
57
#[ lang = "panic_bounds_check" ] // needed by codegen for panic on OOB array/slice access
63
58
fn panic_bounds_check ( index : usize , len : usize ) -> ! {
64
59
if cfg ! ( feature = "panic_immediate_abort" ) {
65
- // remove `unsafe` (and safety comment) on bootstrap bump
66
- #[ cfg_attr( not( bootstrap) , allow( unused_unsafe) ) ]
67
- // SAFETY: the `abort` intrinsic has no requirements to be called.
68
- unsafe {
69
- super :: intrinsics:: abort ( )
70
- }
60
+ super :: intrinsics:: abort ( )
71
61
}
72
62
73
63
panic ! ( "index out of bounds: the len is {} but the index is {}" , len, index)
@@ -80,12 +70,7 @@ fn panic_bounds_check(index: usize, len: usize) -> ! {
80
70
#[ track_caller]
81
71
pub fn panic_fmt ( fmt : fmt:: Arguments < ' _ > ) -> ! {
82
72
if cfg ! ( feature = "panic_immediate_abort" ) {
83
- // remove `unsafe` (and safety comment) on bootstrap bump
84
- #[ cfg_attr( not( bootstrap) , allow( unused_unsafe) ) ]
85
- // SAFETY: the `abort` intrinsic has no requirements to be called.
86
- unsafe {
87
- super :: intrinsics:: abort ( )
88
- }
73
+ super :: intrinsics:: abort ( )
89
74
}
90
75
91
76
// NOTE This function never crosses the FFI boundary; it's a Rust-to-Rust call
0 commit comments