Commit 071e0c1
committed
fix: Create proper nested module structure for wit_bindgen::rt
The generated code expects crate::wit_bindgen::rt::run_ctors_once() but
the previous implementation only did `pub use wit_bindgen_rt as wit_bindgen;`
which made wit_bindgen an alias, not a module with an rt submodule.
Fixed by creating the proper nested structure:
pub mod wit_bindgen {
pub use wit_bindgen_rt as rt;
}
This provides:
- crate::wit_bindgen (module)
- crate::wit_bindgen::rt (wit_bindgen_rt crate)
Fixes error:
error[E0433]: failed to resolve: could not find `rt` in `wit_bindgen`
--> hello_component_wrapper_guest.rs:113:29
|
113 | crate::wit_bindgen::rt::run_ctors_once();
| ^^ could not find `rt` in `wit_bindgen`1 parent 7e6f934 commit 071e0c1
1 file changed
+9
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
64 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
65 | 66 | | |
66 | 67 | | |
67 | 68 | | |
| |||
70 | 71 | | |
71 | 72 | | |
72 | 73 | | |
73 | | - | |
74 | | - | |
75 | | - | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
76 | 79 | | |
77 | 80 | | |
78 | 81 | | |
| |||
0 commit comments