File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -687,6 +687,7 @@ impl InterfaceGenerator<'_> {
687687 uwrite ! (
688688 macro_src,
689689 "
690+ const _: () = {{
690691 #[doc(hidden)]
691692 #[export_name = \" cabi_post_{export_name}\" ]
692693 #[allow(non_snake_case)]
@@ -708,7 +709,8 @@ impl InterfaceGenerator<'_> {
708709 for param in params. iter ( ) {
709710 uwrite ! ( macro_src, "{param}," ) ;
710711 }
711- uwriteln ! ( macro_src, ")\n }}" ) ;
712+ uwriteln ! ( macro_src, ")\n }}" ) ; // close function call and function
713+ uwriteln ! ( macro_src, "\n }};" ) ; // close `const _: () = { ...`
712714
713715 let mut f = FunctionBindgen :: new ( self , params) ;
714716 f. gen . resolve . post_return ( func, & mut f) ;
Original file line number Diff line number Diff line change @@ -184,9 +184,20 @@ mod symbol_does_not_conflict {
184184 foo: func()
185185 }
186186
187+ interface bar1 {
188+ bar: func() -> string
189+ }
190+
191+ interface bar2 {
192+ bar: func() -> string
193+ }
194+
195+
187196 world foo {
188197 export foo1
189198 export foo2
199+ export bar1
200+ export bar2
190201 }
191202 " ,
192203 } ) ;
@@ -201,5 +212,17 @@ mod symbol_does_not_conflict {
201212 fn foo ( ) { }
202213 }
203214
215+ impl exports:: my:: inline:: bar1:: Bar1 for Component {
216+ fn bar ( ) -> String {
217+ String :: new ( )
218+ }
219+ }
220+
221+ impl exports:: my:: inline:: bar2:: Bar2 for Component {
222+ fn bar ( ) -> String {
223+ String :: new ( )
224+ }
225+ }
226+
204227 export_foo ! ( Component ) ;
205228}
You can’t perform that action at this time.
0 commit comments