-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
wasm_bindgen(skip) in cfg_attr #2703
Comments
Sorry I'm not sure why this would be happening. |
This is an example:
It produces this error:
|
The error on |
fails the same way. |
I found a solution.
It works. But in some way it should be the responsibility of the |
I do not believe that there is something I'm unfamiliar with |
it's fine. i guess I'll just wait and see what the future has to offer. In the meantime, this is my workaround: #[cfg(target_arch = "wasm32")]
#[wasm_bindgen::prelude::wasm_bindgen]
pub struct MyStruct {
#[wasm_bindgen::prelude::wasm_bindgen(skip)]
pub my_field: String,
}
#[cfg(not(target_arch = "wasm32"))]
pub struct MyStruct {
pub my_field: String,
} a bit cumbersome, but it works. |
I believe I found a fix which doesn't require Overview:
I think I have a POC working with tests passing and would be happy to work on getting it to a PR state. |
That sounds workable indeed. I'm hoping the implementation can be actually lightweight. Happy to review a PR! Would need a good testsuite though! |
Opened #4351 with proposed fix |
Hello
I tried to use
#[cfg_attr(feature = "wasm-bindgen", wasm_bindgen(skip))]
but I get this:But it works for other macros like derive. Is this a bug or does a workaround exist?
The text was updated successfully, but these errors were encountered: