Skip to content

Commit 2f8893b

Browse files
committed
fix: make bitflags macro publicly accessible from generated bindings
Changed pub(crate) use bitflags; to pub use bitflags::bitflags; in the embedded wit_bindgen runtime. This allows external crates that depend on the generated bindings to access the bitflags macro when they use WASI filesystem interfaces. The pub(crate) visibility restricted access to within the bindings crate itself, preventing downstream users from accessing the macro through the expected path: crate::wit_bindgen::rt::bitflags::bitflags! Tested with: - //examples/basic:hello_component_bindings_host (native-guest mode) - //tools/checksum_updater_wasm:checksum_updater_wasm_component (WASI filesystem)
1 parent 3c83680 commit 2f8893b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

rust/rust_wasm_component_bindgen.bzl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,9 @@ pub mod wit_bindgen {
160160
161161
// Bitflags module for WASI interfaces
162162
pub mod bitflags {
163-
// Re-export bitflags macro without #[macro_export]
163+
// Re-export bitflags macro for public access from other crates
164164
// Generated code expects: crate::wit_bindgen::rt::bitflags::bitflags!
165-
pub(crate) use bitflags;
165+
pub use bitflags::bitflags;
166166
}
167167
}
168168
}
@@ -254,9 +254,9 @@ pub mod wit_bindgen {
254254
255255
// Bitflags module for WASI interfaces
256256
pub mod bitflags {
257-
// Re-export bitflags macro without #[macro_export]
257+
// Re-export bitflags macro for public access from other crates
258258
// Generated code expects: crate::wit_bindgen::rt::bitflags::bitflags!
259-
pub(crate) use bitflags;
259+
pub use bitflags::bitflags;
260260
}
261261
}
262262
}

0 commit comments

Comments
 (0)