File tree Expand file tree Collapse file tree 2 files changed +11
-13
lines changed
Expand file tree Collapse file tree 2 files changed +11
-13
lines changed Original file line number Diff line number Diff line change @@ -41,18 +41,17 @@ This is automatically available as `@crates//:wit-bindgen-rt` through the crates
4141- ` wit-bindgen ` = Procedural macro crate for ` generate!() ` macro
4242- ` wit-bindgen-rt ` = Runtime crate for CLI-generated bindings (what we need)
4343
44- #### 2. Simplified Runtime Wrapper (rust/rust_wasm_component_bindgen.bzl:58-79 )
44+ #### 2. Simplified Runtime Wrapper (rust/rust_wasm_component_bindgen.bzl:58-78 )
4545
4646** Before** : 114 lines of embedded runtime stubs
47- ** After** : 6 lines of simple re-exports
47+ ** After** : 1 line of simple re-export
4848
4949``` rust
50- // Re-export wit-bindgen-rt as wit_bindgen to provide proper runtime implementation
51- // The wit-bindgen CLI generates code that expects: crate:: wit_bindgen::rt
50+ // Re-export wit-bindgen-rt as wit_bindgen to provide the runtime module
51+ // This provides wit_bindgen::rt with proper allocator integration
5252pub use wit_bindgen_rt as wit_bindgen;
5353
54- // Re-export the export macro at crate level for convenience
55- pub use wit_bindgen_rt :: export;
54+ // Note: export! macro is generated by wit-bindgen CLI (via --pub-export-macro)
5655```
5756
5857#### 3. Added Dependencies to Bindings Libraries (lines 326, 337)
Original file line number Diff line number Diff line change @@ -57,25 +57,24 @@ def _generate_wrapper_impl(ctx):
5757
5858 # Create wrapper content - re-export wit-bindgen-rt as wit_bindgen
5959 # The wit-bindgen CLI generates code that expects: crate::wit_bindgen::rt
60- # wit-bindgen-rt provides the runtime support ( export macro, allocator, etc)
60+ # The CLI also generates the export! macro with --pub-export-macro flag
6161 wrapper_content = """// Generated wrapper for WIT bindings
6262//
6363// This wrapper re-exports wit-bindgen-rt as wit_bindgen to provide the runtime
6464// at the path expected by wit-bindgen CLI (--runtime-path crate::wit_bindgen::rt)
65+ //
66+ // The export! macro is generated by wit-bindgen CLI (via --pub-export-macro)
6567
6668// Suppress clippy warnings for generated code
6769#![allow(clippy::all)]
6870#![allow(unused_imports)]
6971#![allow(dead_code)]
7072
71- // Re-export wit-bindgen-rt as wit_bindgen to provide proper runtime implementation
72- // This provides the export! macro, rt module with correct allocator integration
73+ // Re-export wit-bindgen-rt as wit_bindgen to provide the runtime module
74+ // This provides wit_bindgen:: rt with proper allocator integration
7375pub use wit_bindgen_rt as wit_bindgen;
7476
75- // Re-export the export macro at crate level for convenience
76- pub use wit_bindgen_rt::export;
77-
78- // Generated bindings follow:
77+ // Generated bindings follow (including export! macro):
7978"""
8079
8180 # Concatenate wrapper content with generated bindings
You can’t perform that action at this time.
0 commit comments