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

no_std does not work with statics #3258

Closed
FrancisRussell opened this issue Jan 22, 2023 · 2 comments
Closed

no_std does not work with statics #3258

FrancisRussell opened this issue Jan 22, 2023 · 2 comments
Labels

Comments

@FrancisRussell
Copy link

FrancisRussell commented Jan 22, 2023

It appears that no_std does not work with static imports. If I understand correct, the issue is to do with this line which requires the thread_local macro from the standard library.

When compiling I get errors of the form:

error: cannot find macro `thread_local` in this scope
  --> src/node/process.rs:55:5
   |
55 |     #[wasm_bindgen(module = "process")]
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ in this procedural macro expansion
   |
  ::: /home/fpr/local/cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/wasm-bindgen-macro-0.2.83/src/lib.rs:9:1
   |
9  | pub fn wasm_bindgen(attr: TokenStream, input: TokenStream) -> TokenStream {
   | ------------------------------------------------------------------------- in this expansion of `#[wasm_bindgen]`
   |
   = note: `thread_local` is in scope, but it is an attribute: `#[thread_local]`

and

error[E0425]: cannot find value `_VAL` in this scope
   --> src/node/path.rs:168:5
    |
168 |     #[wasm_bindgen(module = "path")]
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |     |
    |     not found in this scope
    |     in this procedural macro expansion
    |
   ::: /home/fpr/local/cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/wasm-bindgen-macro-0.2.83/src/lib.rs:9:1
    |
9   | pub fn wasm_bindgen(attr: TokenStream, input: TokenStream) -> TokenStream {
    | ------------------------------------------------------------------------- in this expansion of `#[wasm_bindgen]
@Gurtej1316
Copy link

@FrancisRussell did you find the solution I am also facing same error. Can you please tell me how did you resolved it?

@daxpedda
Copy link
Collaborator

no_std is currently not supported by wasm-bindgen.
See #2689 (comment).

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

No branches or pull requests

3 participants