Giter Site home page Giter Site logo

Comments (4)

eduardvercaemer avatar eduardvercaemer commented on May 27, 2024 3

For anyone trying to get around this you can try this in your Cargo.toml

wasm-bindgen = "=0.2.84"

from stdweb.

sdasda7777 avatar sdasda7777 commented on May 27, 2024 1

Jeez, I'm not pinned to a higher version, but why did I have to waste three hours debugging this?

from stdweb.

rdbisme avatar rdbisme commented on May 27, 2024

Hello, downgrading wasm-bindgen is a no-go for me since I need to use the latest version of the Cloudflare workers rust runtime, and they pin to wasm-bindgen=0.2.86.

Is there another way of fixing this?

from stdweb.

Dampfwalze avatar Dampfwalze commented on May 27, 2024

The suggestion by @eduardvercaemer does fix the compile error, but pinning wasm-bindgen has other undesired impacts for me and really should not be the solution to the problem.

I think I found the issue! It is within these lines (Exactly where the error points to):

extern "C" {
fn wasm_bindgen_initialize(
memory: JsValue,
table: JsValue,
alloc: &Closure< Fn( usize ) -> *mut u8 >,
free: &Closure< Fn( *mut u8, usize ) >
) -> JsValue;
}

I couldn't make sense of the error, but I looked at the docs of the Closure struct. Interestingly, in the examples, it is always used with the dyn keyword, which makes sense. The fix looks like this:

Closure<dyn Fn(...) -> ...>

On line 75 and 76 there is a warning: trait objects without an explicit 'dyn' are deprecated. I guess historically, rust implicitly added the dyn keyword, but at some point that feature got removed... Probably for the better. But since this package does not receive any updates (for 5 years, FIVE YEARS!!!), it is full of similar deprecation warnings that are never fixed. This is just the first instance where it broke. I am not sure why it works when pinning wasm_bindgen though.

This crate really needs a general overhaul to fix all the warnings! It has thousands of dependents, it is crucial that this crate does not brake! @koute

from stdweb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.