RustBufferI is defined at the package level, depending on the rust library being built. However, one library may refer to other libraries which expose uniffi types. When this happens, uniffi-bindgen-go produces multiple Go packages, one for each library. However, each package defines its own RustBufferI. This can cause the compiler to get confused and return vague sounding errors:
matrix_sdk_ffi.go:6302:3: type func(rb matrix_sdk.RustBufferI) matrix_sdk.RoomPowerLevelChanges of matrix_sdk.FfiConverterTypeRoomPowerLevelChangesINSTANCE.Lift does not match inferred type func(RustBufferI) U for func(T) U
This is saying that matrix_sdk.RustBufferI != RustBufferI so the generated code cannot compile. This is fixed by manually choosing one RustBufferI and sticking with it. uniffi-bindgen-go should handle this better, by choosing the leaf package (due to circular imports you can't always choose the main package).
RustBufferI
is defined at the package level, depending on the rust library being built. However, one library may refer to other libraries which expose uniffi types. When this happens,uniffi-bindgen-go
produces multiple Go packages, one for each library. However, each package defines its ownRustBufferI
. This can cause the compiler to get confused and return vague sounding errors:This is saying that
matrix_sdk.RustBufferI != RustBufferI
so the generated code cannot compile. This is fixed by manually choosing oneRustBufferI
and sticking with it.uniffi-bindgen-go
should handle this better, by choosing the leaf package (due to circular imports you can't always choose the main package).