@@ -19,6 +19,7 @@ sugar for dynamic allocations via `malloc` and `free`:
19
19
#![feature(lang_items, box_syntax, start, libc, core_intrinsics)]
20
20
#![no_std]
21
21
use core::intrinsics;
22
+ use core::panic::PanicInfo;
22
23
23
24
extern crate libc;
24
25
@@ -50,7 +51,7 @@ fn main(_argc: isize, _argv: *const *const u8) -> isize {
50
51
}
51
52
52
53
#[lang = "eh_personality"] extern fn rust_eh_personality() {}
53
- #[lang = "panic_fmt "] extern fn rust_begin_panic() -> ! { unsafe { intrinsics::abort() } }
54
+ #[lang = "panic_impl "] extern fn rust_begin_panic(info: &PanicInfo ) -> ! { unsafe { intrinsics::abort() } }
54
55
#[lang = "eh_unwind_resume"] extern fn rust_eh_unwind_resume() {}
55
56
#[no_mangle] pub extern fn rust_eh_register_frames () {}
56
57
#[no_mangle] pub extern fn rust_eh_unregister_frames () {}
@@ -110,6 +111,7 @@ in the same format as C:
110
111
#![feature(start)]
111
112
#![no_std]
112
113
use core::intrinsics;
114
+ use core::panic::PanicInfo;
113
115
114
116
// Pull in the system libc library for what crt0.o likely requires.
115
117
extern crate libc;
@@ -134,12 +136,9 @@ pub extern fn rust_eh_personality() {
134
136
pub extern fn rust_eh_unwind_resume() {
135
137
}
136
138
137
- #[lang = "panic_fmt "]
139
+ #[lang = "panic_impl "]
138
140
#[no_mangle]
139
- pub extern fn rust_begin_panic(_msg: core::fmt::Arguments,
140
- _file: &'static str,
141
- _line: u32,
142
- _column: u32) -> ! {
141
+ pub extern fn rust_begin_panic(info: &PanicInfo) -> ! {
143
142
unsafe { intrinsics::abort() }
144
143
}
145
144
```
@@ -155,6 +154,7 @@ compiler's name mangling too:
155
154
#![no_std]
156
155
#![no_main]
157
156
use core::intrinsics;
157
+ use core::panic::PanicInfo;
158
158
159
159
// Pull in the system libc library for what crt0.o likely requires.
160
160
extern crate libc;
@@ -179,12 +179,9 @@ pub extern fn rust_eh_personality() {
179
179
pub extern fn rust_eh_unwind_resume() {
180
180
}
181
181
182
- #[lang = "panic_fmt "]
182
+ #[lang = "panic_impl "]
183
183
#[no_mangle]
184
- pub extern fn rust_begin_panic(_msg: core::fmt::Arguments,
185
- _file: &'static str,
186
- _line: u32,
187
- _column: u32) -> ! {
184
+ pub extern fn rust_begin_panic(info: &PanicInfo) -> ! {
188
185
unsafe { intrinsics::abort() }
189
186
}
190
187
```
@@ -215,7 +212,7 @@ called. The language item's name is `eh_personality`.
215
212
216
213
The second function, ` rust_begin_panic ` , is also used by the failure mechanisms of the
217
214
compiler. When a panic happens, this controls the message that's displayed on
218
- the screen. While the language item's name is ` panic_fmt ` , the symbol name is
215
+ the screen. While the language item's name is ` panic_impl ` , the symbol name is
219
216
` rust_begin_panic ` .
220
217
221
218
A third function, ` rust_eh_unwind_resume ` , is also needed if the ` custom_unwind_resume `
@@ -259,8 +256,8 @@ the source code.
259
256
- ` msvc_try_filter ` : ` libpanic_unwind/seh.rs ` (SEH)
260
257
- ` panic ` : ` libcore/panicking.rs `
261
258
- ` panic_bounds_check ` : ` libcore/panicking.rs `
262
- - ` panic_fmt ` : ` libcore/panicking.rs `
263
- - ` panic_fmt ` : ` libstd/panicking.rs `
259
+ - ` panic_impl ` : ` libcore/panicking.rs `
260
+ - ` panic_impl ` : ` libstd/panicking.rs `
264
261
- Allocations
265
262
- ` owned_box ` : ` liballoc/boxed.rs `
266
263
- ` exchange_malloc ` : ` liballoc/heap.rs `
0 commit comments