Implement upcast to virtual base, via synthesized C++ thunk.

This (or rather, the preceding work from earlier CLs) is probably the rest of the questionable part for implementing casting in C++. We need some infrastructure somewhere to support dynamic casts -- not just casting to virtual base (which isn't super interesting right now), but even `dynamic_cast` in its full generality.

Remaining work:

* Fix the hacks in the implementation: this doesn't support cross-crate inheritance, name collisions, etc. -- it's a very rough first pass still.
* Flesh out the matrix of conversions. Right now, this still only does &T->&U, but of course we also need to support this for (pinned) mutable references, and raw pointers.
* Flesh out the casting directions: in particular, we also need to support downcasting.

So, you know, first 90% down, only 90% left. :)

PiperOrigin-RevId: 445065670
10 files changed
tree: 01575328a2d6d4a8bc15623fc2a91de34d2ecb09
  1. cc_template/
  2. common/
  3. docs/
  4. lifetime_annotations/
  5. migrator/
  6. rs_bindings_from_cc/
  7. BUILD
  8. CODE_OF_CONDUCT
  9. CONTRIBUTING
  10. LICENSE
  11. 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.