pd-rs / crankstart

A barely functional, wildly incomplete and basically undocumented Rust crate whose aim is to let you write Games for the Playdate handheld gaming system in Rust.
MIT License
235 stars 24 forks source link

Type mismatch building for hardware. #8

Closed sgeos closed 2 years ago

sgeos commented 2 years ago

Building for hardware errors out due to a type mismatch in crankstat/src/lib.rs.

crankstart$ crank build --device --release --example hello_world
   Compiling crankstart v0.1.0 ($HOME/projects/playdate/crankstart)
error[E0308]: mismatched types
   --> src/lib.rs:328:13
    |
328 |             layout.size() as crankstart_sys::ctypes::realloc_size,
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `u32`, found `u64`
    |
help: you can convert a `u64` to a `u32` and panic if the converted value doesn't fit
    |
328 |             (layout.size() as crankstart_sys::ctypes::realloc_size).try_into().unwrap(),
    |             +                                                     +++++++++++++++++++++

error[E0308]: mismatched types
   --> src/lib.rs:340:13
    |
340 |             new_size as crankstart_sys::ctypes::realloc_size,
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `u32`, found `u64`
    |
help: you can convert a `u64` to a `u32` and panic if the converted value doesn't fit
    |
340 |             (new_size as crankstart_sys::ctypes::realloc_size).try_into().unwrap(),
    |             +                                                +++++++++++++++++++++

For more information about this error, try `rustc --explain E0308`.
error: could not compile `crankstart` due to 2 previous errors
Error: cargo failed with error ExitStatus(unix_wait_status(25856))

Tested with SDK version 1.9.1 on MacOS.

$ crank -V
clank 0.2.3
$ cat $PLAYDATE_SDK_PATH/VERSION.txt
1.9.1
$ uname -vm
Darwin Kernel Version 20.6.0: Wed Nov 10 22:23:07 PST 2021; root:xnu-7195.141.14~1/RELEASE_X86_64 x86_64
$ sysctl kern.osrelease
kern.osrelease: 20.6.0
$ date -u "+%Y-%m-%d %H:%M:%S +0000"
2022-03-14 00:22:31 +0000
rtsuk commented 2 years ago

Should be fixed now.