You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to return a Result<Box< T >> and I am getting the below compile errors.
expected struct std::boxed::Box, found enum std::result::Result
expected enum std::result::Result, found *-ptr
I have tried setting the return type to Result and Box and both compile fine.
Here is a simple proof.
#[cxx::bridge()]mod test {structTest{size:usize,}extern"Rust"{fntest() -> Result<Box<Test>>;}}fntest() -> Result<Box<test::Test>>{Ok(Box::<test::Test>::new(test::Test{size:0}))}
The reason I want to return a Result<Box> is because in my use case T is a rust opaque type, but I made T a shared type to check that both Result and Box compile fine where Result<Box> doesn't.
The text was updated successfully, but these errors were encountered:
exlavasage
changed the title
Can't return Result of Box
Can't return Result<Box<T>>
Sep 21, 2020
I am trying to return a Result<Box< T >> and I am getting the below compile errors.
I have tried setting the return type to Result and Box and both compile fine.
Here is a simple proof.
The reason I want to return a Result<Box> is because in my use case T is a rust opaque type, but I made T a shared type to check that both Result and Box compile fine where Result<Box> doesn't.
The text was updated successfully, but these errors were encountered: