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
  1. lifetime_annotations/
  2. rs_bindings_from_cc/
  3. CODE_OF_CONDUCT
  4. CONTRIBUTING
  5. LICENSE
  6. 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.