bazel /
crubit /
40c2eb87cf6e6b69f2e31d7bd4c45fc235f5e9ff Fix handling of constructors with elided lifetimes.
Before this CL, the generated Default::default and/or From<T>::from
functions would always pass the MaybeUninit<T> `tmp` into the
constructor-wrapping thunk as follows: `tmp.as_mut_ptr()`. This
wouldn't work when eliding lifetimes, when the thunk parameter type
is `&'a mut SomeStruct` rather than `*mut SomeStruct`.
To fix the problem above, this CL starts passing `tmp` as `&mut tmp`.
This works both with references and with pointers, as long as the type
of `__this` is spelled as: `&'a mut MaybeUninint<SomeStruct>`.
PiperOrigin-RevId: 421065397
13 files changed
tree: b0c8aab38a0b08cd9a7c88c8209fefa4255145d5
- lifetime_annotations/
- rs_bindings_from_cc/
- CODE_OF_CONDUCT
- CONTRIBUTING
- LICENSE
- README.md
README.md
Crubit: C++/Rust Bidirectional Interop Tool
Extremely experimental interop tooling for C++ and Rust.
Please don‘t use, this is an experiment and we don’t yet know where will it take us. There will be breaking changes without warning. Unfortunately, we can't take contributions at this point.