-
-
Notifications
You must be signed in to change notification settings - Fork 362
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Hello,
This issue is similar to #1120. The following code is working:
#[cfg_attr(feature = "nodejs", napi)]
pub struct Bar {}
#[cfg_attr(feature = "nodejs", napi)]
impl Bar {
#[napi(constructor)]
pub fn new() -> Self {
Self {}
}
}but changing #[napi(constructor)] to #[cfg_attr(feature = "nodejs", napi(constructor))] will fail:
error: associated `static` items are not allowed
--> ….rs:13:36
|
13 | #[cfg_attr(feature = "nodejs", napi(constructor))]
| ^^^^^^^^^^^^^^^^^
|
= note: this error originates in the attribute macro `napi::bindgen_prelude::ctor` (in Nightly builds, run with -Z macro-backtrace for more info)
etc.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working