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
error[E0277]: the trait bound `ffi::bindgen::Bob: cxx::private::UniquePtrTarget` is not satisfied
--> demo/src/main.rs:32:32
|
32 | pub fn take_bob(a: UniquePtr<Bob>) -> u32;
| ^^^^^^^^^^^^^^ the trait `cxx::private::UniquePtrTarget` is not implemented for `ffi::bindgen::Bob`
|
::: /Users/adetaylor/dev/cxx/src/unique_ptr.rs:14:8
|
14 | T: UniquePtrTarget,
| --------------- required by this bound in `cxx::UniquePtr`
(Context: previously my https://github.com/google/autocxx experiments rewrote the bindgen output to generate a self-contained cxx::bridge, but I believe the better thing is to have lots of ExternTypes pointing from the cxx::bridge to the bindgen output, so I'm trying to make that work. This may be the first of several issues as I dig into it.)
I'm eager to raise a PR to fix this but I can't see the easiest way. Given the context of 2b821e6, I assume some badness occurs if we generate trait impls for aliases to types in other cxx::bridge blocks. Is that the case? If so, I've a feeling we can't distinguish this case versus the type-defined-entirely-outside-cxxbridge case we've got here, and we might need some new syntax. Thoughts?
The text was updated successfully, but these errors were encountered:
I assume some badness occurs if we generate trait impls for aliases to types in other cxx::bridge blocks. Is that the case?
Yes this is the reason. You end up with multiple conflicting impls on the same type with no way to turn it off.
I think what I would prefer is for a module to be able to explicitly request certain impls to be instantiated. We would still keep our current implicit impls for convenience in all the cases where a particular impl is "obviously needed".
Commit 2b821e6 disabled type aliases for non-local types.
This causes problems with this sort of code:
because of course
(Context: previously my https://github.com/google/autocxx experiments rewrote the bindgen output to generate a self-contained
cxx::bridge
, but I believe the better thing is to have lots ofExternType
s pointing from thecxx::bridge
to the bindgen output, so I'm trying to make that work. This may be the first of several issues as I dig into it.)I'm eager to raise a PR to fix this but I can't see the easiest way. Given the context of 2b821e6, I assume some badness occurs if we generate trait impls for aliases to types in other
cxx::bridge
blocks. Is that the case? If so, I've a feeling we can't distinguish this case versus the type-defined-entirely-outside-cxxbridge case we've got here, and we might need some new syntax. Thoughts?The text was updated successfully, but these errors were encountered: