Skip to content

psx is broken with newer Rust versions #35

@cod10129

Description

@cod10129

I was trying to get a demo working, but psx doesn't compile:

PS C:\Users\Redacted\Desktop\PS1\ps1-rust> rustc -V
rustc 1.84.0-nightly (ee612c45f 2024-11-19)
PS C:\Users\Redacted\Desktop\PS1\ps1-rust> cargo psx build
warning: MIPS-I support is experimental
   Compiling psx v0.1.6
warning: MIPS-I support is experimental
error[E0308]: mismatched types
  --> C:\Users\Redacted\.cargo\registry\src\index.crates.io-6f17d22bba15001f\psx-0.1.6\src\panic.rs:19:16
   |
19 |         if let Some(msg) = info.message() {
   |                ^^^^^^^^^   -------------- this expression has type `PanicMessage<'_>`
   |                |
   |                expected `PanicMessage<'_>`, found `Option<_>`
   |
   = note: expected struct `PanicMessage<'_>`
                found enum `Option<_>`

error[E0599]: no function or associated item named `write_slice` found for union `MaybeUninit` in the current scope
   --> C:\Users\Redacted\.cargo\registry\src\index.crates.io-6f17d22bba15001f\psx-0.1.6\src\std.rs:37:30
    |
37  |                 MaybeUninit::write_slice(&mut initialized_part[0..slice.len()], slice);
    |                              ^^^^^^^^^^^ function or associated item not found in `MaybeUninit<_>`
    |

Some errors have detailed explanations: E0308, E0599.
For more information about an error, try `rustc --explain E0308`.
error: could not compile `psx` (lib) due to 2 previous errors

MaybeUninit::write_slice has been renamed to copy_from_slice in Rust PR #116385 (back in February!). Edit: fixed in 8cfc8a5

PanicInfo::message has been stabilized in 1.81 with a different signature, returning PanicMessage. (This occured with the split of core::panic::PanicInfo and std::panic::PanicHookInfo). I see PR #31 in this repo but there hasn't been a crates.io publish since June.

Both of these have now been fixed in the git repository, but that requires declaring a git dependency. The crates.io version of psx is still broken and should be updated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions