Skip to content

Commit 5c02261

Browse files
committed
Print file and line on panic
1 parent 5c0199a commit 5c02261

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,12 +211,12 @@ fn enable_write_protect_bit() {
211211
#[no_mangle]
212212
pub extern "C" fn rust_begin_panic(
213213
msg: core::fmt::Arguments,
214-
_file: &'static str,
215-
_line: u32,
214+
file: &'static str,
215+
line: u32,
216216
_column: u32,
217217
) -> ! {
218218
use core::fmt::Write;
219-
write!(printer::Printer, "PANIC: {}", msg).unwrap();
219+
write!(printer::Printer, "PANIC: {} in {}:{}", msg, file, line).unwrap();
220220

221221
loop {}
222222
}

0 commit comments

Comments
 (0)