From a62adb4d8d1cd77a8f7611f2d9a262168152260c Mon Sep 17 00:00:00 2001 From: Charles Horn Date: Sun, 25 Aug 2024 10:18:11 +1200 Subject: [PATCH 1/3] psx: Updates to panic info for 1.81.0 (~Jun 2024) `panic_info_message` has been stable since 1.81.0 see https://stackoverflow.com/questions/78900800/trying-to-access-the-panic-info-message-causes-a-mismatched-types-error and https://github.com/rust-lang/rust/pull/115974 --- psx/src/lib.rs | 2 -- psx/src/panic.rs | 6 ------ 2 files changed, 8 deletions(-) diff --git a/psx/src/lib.rs b/psx/src/lib.rs index 6cec8ef..125130a 100644 --- a/psx/src/lib.rs +++ b/psx/src/lib.rs @@ -40,8 +40,6 @@ )] // Used to implement `ImplsAsCStr` trait #![feature(min_specialization)] -// For the panic handler -#![feature(panic_info_message)] // For global_asm! on MIPS #![feature(asm_experimental_arch)] // For `__start`'s return type diff --git a/psx/src/panic.rs b/psx/src/panic.rs index ed3e266..ba72f95 100644 --- a/psx/src/panic.rs +++ b/psx/src/panic.rs @@ -44,9 +44,6 @@ fn min_panic(info: &core::panic::PanicInfo) { println!("Panicked at unknown location") }, } - if let Some(msg) = info.message() { - println!("{}", msg) - } } fn normal_panic(info: &core::panic::PanicInfo) { @@ -70,9 +67,6 @@ fn normal_panic(info: &core::panic::PanicInfo) { dprintln!(txt, "Panicked at unknown location"); }, } - if let Some(msg) = info.message() { - dprintln!(txt, "{}", msg); - } fb.draw_sync(); fb.wait_vblank(); fb.swap(); From 421fab87deca4a897cde6d18e7999789f2b934ce Mon Sep 17 00:00:00 2001 From: Charles Horn Date: Sun, 25 Aug 2024 14:45:50 +1200 Subject: [PATCH 2/3] re-add the info.message() output (oops!) --- psx/src/panic.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/psx/src/panic.rs b/psx/src/panic.rs index ba72f95..a819963 100644 --- a/psx/src/panic.rs +++ b/psx/src/panic.rs @@ -44,6 +44,7 @@ fn min_panic(info: &core::panic::PanicInfo) { println!("Panicked at unknown location") }, } + println!("{}", info.message()); } fn normal_panic(info: &core::panic::PanicInfo) { @@ -67,6 +68,7 @@ fn normal_panic(info: &core::panic::PanicInfo) { dprintln!(txt, "Panicked at unknown location"); }, } + dprintln!(txt, "{}", info.message()); fb.draw_sync(); fb.wait_vblank(); fb.swap(); From b760e45c2d65fa1a7514684e5bbba56183a644d2 Mon Sep 17 00:00:00 2001 From: Charles Horn Date: Sun, 25 Aug 2024 14:48:59 +1200 Subject: [PATCH 3/3] update README to latest nightly build (> 0.81.0) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f185db0..07844d0 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@

This is a basic SDK to run custom Rust code on a PlayStation 1. It works with -Rust nightly version equal to or later than `2022-11-04`. Use +Rust nightly version equal to or later than `2024-08-23`. Use [`rustup`](https://www.rust-lang.org/) to install the rust toolchain as follows. ```