Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

psx is broken with newer Rust versions #35

Closed
cod10129 opened this issue Nov 20, 2024 · 1 comment
Closed

psx is broken with newer Rust versions #35

cod10129 opened this issue Nov 20, 2024 · 1 comment

Comments

@cod10129
Copy link

cod10129 commented Nov 20, 2024

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.

@ayrtonm
Copy link
Owner

ayrtonm commented Dec 23, 2024

Hi @cod10129 I updated the README's rustup command to a specific nightly that works, added a link on adding git dependencies and pushed a new version to crates.io. I'll try to keep a wide window as possible of working rustc versions listed in the README, but also I tweaked the wording to note that newer versions might be broken because of unstable features and I'm not promising updates to crates.io in a regular schedule.

Also I'm a little surprised people have been discovering this SDK through crates.io rather than github first. For this project I've definitely made extensive use of unstable features (and accepted the potential breakage) since I assumed any potential users would have the SDK source readily available and could easily track down these issues. On some level this SDK will always be somewhat experimental, but I'll try to avoid adding the more unstable nightly features since I know dealing with broken code can be annoying.

@ayrtonm ayrtonm closed this as completed Dec 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants