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

Updating the nightly version of rust gives error on module path: #4115

Closed
amiyatulu opened this issue Sep 16, 2024 · 5 comments · Fixed by #4146
Closed

Updating the nightly version of rust gives error on module path: #4115

amiyatulu opened this issue Sep 16, 2024 · 5 comments · Fixed by #4146
Labels

Comments

@amiyatulu
Copy link

While importing the module it now gives following error:

#[wasm_bindgen(module = "/src/package.js")]
extern "C" {
    #[wasm_bindgen]
    pub fn helloworld();
error: constant evaluation is taking a long time
   --> /home/amiya/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/mod.rs:118:9
    |
118 |         ptr::metadata(self)
    |         ^^^^^^^^^^^^^^^^^^^
    |
    = note: this lint makes sure the compiler doesn't get stuck due to infinite loops in const eval.
            If your compilation actually takes a long time, you can safely allow the lint.
help: the constant being evaluated
   --> src/js_extension_binding.rs:5:1
    |
5   | #[wasm_bindgen(module = "/src/package.js")]
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = note: `#[deny(long_running_const_eval)]` on by default
    = note: this error originates in the attribute macro `wasm_bindgen` (in Nightly builds, run with -Z macro-backtrace for more info)

note: erroneous constant encountered
 --> src/js_extension_binding.rs:5:1
  |
5 | #[wasm_bindgen(module = "/src/package.js")]
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: this note originates in the attribute macro `wasm_bindgen` (in Nightly builds, run with -Z macro-backtrace for more info)

@amiyatulu amiyatulu added the bug label Sep 16, 2024
@amiyatulu amiyatulu changed the title Updating the nightly version of rust gives errror: Updating the nightly version of rust gives error on module path: Sep 16, 2024
@lucasmerlin
Copy link

I'm having the same problem, but for me it came after updating wasm_bindgen from 0.2.92 to 0.2.93. So I guess it's a combination of wasm_bindgen 0.2.93 and a recent rust nightly version (I'm using 1.82.0-nightly (2c93fabd9 2024-08-15))?
@amiyatulu do you know which nightly version you were updating from?

@daxpedda
Copy link
Collaborator

I'm unable to reproduce it, maybe it was addressed in the latest nightly already?
Let me know if this is still an issue and I can reopen!

@daxpedda daxpedda closed this as not planned Won't fix, can't repro, duplicate, stale Sep 28, 2024
@lucasmerlin
Copy link

lucasmerlin commented Sep 29, 2024

Still happening with the current nightly :/

With 1.83.0-nightly (fa724e5d8 2024-09-27):

error: constant evaluation is taking a long time
   --> /Users/lucasprivat/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/slice/mod.rs:118:9
    |
118 |         ptr::metadata(self)
    |         ^^^^^^^^^^^^^^^^^^^
    |
    = note: this lint makes sure the compiler doesn't get stuck due to infinite loops in const eval.
            If your compilation actually takes a long time, you can safely allow the lint.
help: the constant being evaluated
   --> hp-mobile-interop/src/web.rs:23:3
    |
23  |   #[wasm_bindgen(module = "/js/out/index.js")]
    |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = note: `#[deny(long_running_const_eval)]` on by default
    = note: this error originates in the attribute macro `wasm_bindgen` (in Nightly builds, run with -Z macro-backtrace for more info)

note: erroneous constant encountered
  --> hp-mobile-interop/src/web.rs:23:3
   |
23 |   #[wasm_bindgen(module = "/js/out/index.js")]
   |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: this note originates in the attribute macro `wasm_bindgen` (in Nightly builds, run with -Z macro-backtrace for more info)

The js module is quite big (almost 1mb) maybe it's related to that?

@daxpedda
Copy link
Collaborator

daxpedda commented Oct 8, 2024

Thank you for getting back on this, I was able to reproduce it with this.
It should be fixed with #4146.

@lucasmerlin
Copy link

Awesome, this fixed it for me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants