ZettaScaleLabs / stabby

A Stable ABI for Rust with compact sum-types
Other
328 stars 13 forks source link

Option of string not ffi safe #67

Open ZakharEl opened 6 months ago

ZakharEl commented 6 months ago

I have a trait that has a method that returns a stabby::option::Option. It says that it resturns the type stabby::stabby_abi::End, which is not FFI-safe.

ZakharEl commented 6 months ago

Ah it only gives me trouble with methods returning stabby::option::Option\<stabby::string::String> if I use stabby::option::Option::None() in the method body.

ZakharEl commented 6 months ago

if used in stable trait default method body it will not compile but if the method default is left undefined and then the method is implemented for a type using stabby::option::Option::None() in its body it will compile with same messages as a warning instead of an error.

xuchaoqian commented 6 months ago

I have a trait that has a method that returns a stabby::option::Optionstabby::string::String. It says that it resturns the type stabby::stabby_abi::End, which is not FFI-safe.

Met the similar case. It should be a bug.