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
use anyhow::Result;#[cxx::bridge]mod ffi {extern"Rust"{fntest() -> Result<&'static i32>;}}fntest() -> Result<&'static i32>{Ok(&0)}
The return type is being implemented by a pointer out-parameter, and it's not possible for that pointer to point to a reference in C++.
$ cargo checktarget/debug/build/example-283878198746b170/out/cxxbridge/sources/example/src/main.rs.cc:80:60: error: 'return$' declared as a pointer to a reference of type 'const ::std::int32_t &' (aka 'const int &')::rust::repr::PtrLen cxxbridge1$test(const ::std::int32_t &*return$) noexcept; ^target/debug/build/example-283878198746b170/out/cxxbridge/sources/example/src/main.rs.cc:51:5: error: union member 'value' has reference type 'const int &' T value; ^target/debug/build/example-283878198746b170/out/cxxbridge/sources/example/src/main.rs.cc:84:47: note: in instantiation of template class 'rust::cxxbridge1::MaybeUninit<const int &>' requested here ::rust::MaybeUninit<const ::std::int32_t &> return$; ^
The text was updated successfully, but these errors were encountered:
The return type is being implemented by a pointer out-parameter, and it's not possible for that pointer to point to a reference in C++.
The text was updated successfully, but these errors were encountered: