squirrel-labs / ratatosk

Rask is a platformer game built with WASM and Rust
https://rask.rocks
MIT License
15 stars 1 forks source link

Latest rust-channel (2020-03-19) breaks build due to `wee_alloc-4.5` #59

Closed Ma27 closed 4 years ago

Ma27 commented 4 years ago

When I try to build ratatosk using cargo make all with nightly-2020-03-19, it breaks with the following error while building rask-wasm-logic:

[...]
   Compiling rand_core v0.5.1
error[E0053]: method `alloc` has an incompatible type for trait
    --> /home/ma27/.cargo/git/checkouts/wee_alloc-476ef942b75426ec/7a241cd/wee_alloc/src/lib.rs:1149:5
     |
1149 |     unsafe fn alloc(&mut self, layout: Layout) -> Result<NonNull<u8>, AllocErr> {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected normal fn, found unsafe fn
     |
     = note: expected fn pointer `fn(&mut &'b WeeAlloc<'a>, core::alloc::Layout) -> core::result::Result<(core::ptr::NonNull<u8>, usize), _>`
                found fn pointer `unsafe fn(&mut &'b WeeAlloc<'a>, core::alloc::Layout) -> core::result::Result<core::ptr::NonNull<u8>, _>`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0053`.
error: could not compile `wee_alloc`.

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: build failed
[cargo-make [3]] ERROR - Error while executing command, exit code: 101
[cargo-make [3]] WARN - Build Failed.
[cargo-make [2]] ERROR - Error while executing command, exit code: 1
[cargo-make [2]] WARN - Build Failed.
[cargo-make [1]] ERROR - Error while executing command, exit code: 1
[cargo-make [1]] WARN - Build Failed.
[cargo-make [1]] ERROR - Error while executing command, exit code: 1
[cargo-make [1]] WARN - Build Failed.

This is preventing me from updating our default rust channel (and making it possible to use MIRI btw).

(And no, removing the unsafe-keyword from the fn-definitions does not fix the issue, with that being done, the browser isn't able to allocate memory anymore).

cc @NatrixAeria am I missing some (more or less obvious) details here? (no rush though, will investigate tomorrow, just wondered if you have an idea where this comes from :))

TrueDoctor commented 4 years ago

did you notice the difference in:

+ Result<(core::ptr::NonNull<u8>, usize), _>
- Result<core::ptr::NonNull<u8>, _>

?

Ma27 commented 4 years ago

Oof I really hope that the issue wasn't just a trivial signature mismatch :sweat_smile:

Will check tomorrow :)