I have nested crates.
Crate A
Crate B
using Crate A
Crate C
using Crate B
with following Cargo.toml
# CrateA/Cargo.toml
[features]
webgpu = [
"web-sys",
'web-sys/Document',
'web-sys/Element',
'web-sys/GpuAdapter',
...
]
# CrateB/Cargo.toml
[features]
webgpu = ["CrateA/webgpu"]
[dependencies]
CrateA = {path = "../CrateA", default-features = false}
# CrateC/Cargo.toml
[dependencies]
CrateB = {path = "../CrateB" , features = ["webgpu"], default-features = false}
and when I tried to build CrateC, it failed with following error.
error[E0432]: unresolved import `web_sys::GpuAdapter`
|
8 | use web_sys::GpuAdapter;
| ^^^^^^^^^^^^^^^^^^^ no `GpuAdapter` in the root
web_sys::GpuAdapter
is defined in web-sys
only when web-sys/GpuAdapter
feature is used.
I had assumed the above Cargo.toml settings are fine with those scenario but it was not.
What can I do for do this properly?
self solved.
I just for forgot --cfg=web_sys_unstable_apis
for build flags.