boozook / playdate

Playdate Build Tools and API
https://gamedev.social/@playdaters
MIT License
125 stars 6 forks source link

Mismatched types error #398

Closed paulstraw closed 3 weeks ago

paulstraw commented 3 weeks ago

In a new project (cargo playdate init --lib --full-metadata --deps="playdate"), I'm getting the following error:

~/dev/crank-defense-force » cargo playdate run
      Assets planning complete for all requested targets
        Skip crank-defense-force v0.1.0 (/Users/paulstraw/dev/crank-defense-force) assets cache state is Same
   Compiling playdate-sys v0.4.2
error: error[E0308]: mismatched types
  --> /Users/paulstraw/.cargo/registry/src/index.crates.io-6f17d22bba15001f/playdate-sys-0.4.2/src/sys/panic.rs:27:17
   |
27 |     let _ = if let Some(message) = panic_info.message() {
   |                    ^^^^^^^^^^^^^   -------------------- this expression has type `PanicMessage<'_>`
   |                    |
   |                    expected `PanicMessage<'_>`, found `Option<_>`
   |
   = note: expected struct `PanicMessage<'_>`
                found enum `Option<_>`

error: aborting due to 1 previous error
error: could not compile `playdate-sys` (lib) due to 2 previous errors
error: process exited unsuccessfully: exit status: 101
error: build not successful
~/dev/crank-defense-force » rustc --version
rustc 1.81.0-nightly (ba1d7f4a0 2024-06-29)

I'm not sure whether this is something misconfigured on my system, sorry if so!

boozook commented 3 weeks ago

Yup, thanks. This is in the new nightly, but I can't update to the latest because of https://github.com/boozook/playdate/issues/397

boozook commented 3 weeks ago

I'll fix it. Already has fix in my private drafts.

boozook commented 3 weeks ago

By the way I recommend to use toolchain version that mentioned there. Soon I'll update it to 06-30 or something nearby.

paulstraw commented 3 weeks ago

Using nightly-2024-05-28 to match rust-toolchain.toml worked! IMO this is resolved, but it sounds like you might want to make another change based on it? Will leave open, but feel free to close if I've misunderstood.

boozook commented 3 weeks ago

@paulstraw toolchain updated to nightly-2024-06-30 from now. Panic fixed.

https://github.com/boozook/playdate/blob/1fc9b65b3fc07b7a181358da2fca5e51fef554b7/rust-toolchain.toml#L2