11use crate :: bindgen:: { FunctionBindgen , POINTER_SIZE_EXPRESSION } ;
22use crate :: {
3- ConstructorReturnType , FnSig , Identifier , InterfaceName , Ownership , RuntimeItem , RustFlagsRepr ,
4- RustWasm , TypeGeneration , classify_constructor_return_type , full_wit_type_name , int_repr ,
5- to_rust_ident , to_upper_camel_case , wasm_type ,
3+ classify_constructor_return_type , full_wit_type_name , int_repr , to_rust_ident ,
4+ to_upper_camel_case , wasm_type , ConstructorReturnType , FnSig , Identifier , InterfaceName ,
5+ Ownership , RuntimeItem , RustFlagsRepr , RustWasm , TypeGeneration ,
66} ;
77use anyhow:: Result ;
88use heck:: * ;
@@ -11,7 +11,7 @@ use std::fmt::Write as _;
1111use std:: mem;
1212use wit_bindgen_core:: abi:: { self , AbiVariant , LiftLower } ;
1313use wit_bindgen_core:: {
14- AnonymousTypeGenerator , Source , TypeInfo , dealias, uwrite, uwriteln, wit_parser:: * ,
14+ dealias, uwrite, uwriteln, wit_parser:: * , AnonymousTypeGenerator , Source , TypeInfo ,
1515} ;
1616
1717pub struct InterfaceGenerator < ' a > {
@@ -303,6 +303,7 @@ macro_rules! {macro_name} {{
303303 unreachable ! ( )
304304 }
305305 } ;
306+ let module = module. replace ( ':' , "_" ) . replace ( '#' , "_" ) ;
306307 let camel = name. to_upper_camel_case ( ) ;
307308 uwriteln ! (
308309 self . src,
@@ -1215,6 +1216,7 @@ unsafe fn call_import(&mut self, _params: Self::ParamsLower, _results: *mut u8)
12151216 } ;
12161217 let export_prefix = self . r#gen . opts . export_prefix . as_deref ( ) . unwrap_or ( "" ) ;
12171218 let export_name = func. legacy_core_export_name ( wasm_module_export_name. as_deref ( ) ) ;
1219+ let export_name = export_name. replace ( ':' , "_" ) . replace ( '#' , "_" ) ;
12181220 let export_name = if async_ {
12191221 format ! ( "[async-lift]{export_name}" )
12201222 } else {
0 commit comments