bazel /
crubit /
4f06f8381cd3a640646be69745cc3d897ea413bc Allow generated items to include C++ code.
In particular, this means:
* GeneratedItem must include C++ code
* generate_rs_api must also return C++ code. (At which point, we may as well have it call generate_rs_api, and rename it to generate_bindings_tokens or similar)
The use case here is that some bindings must query C++ for information about things at runtime, calling functions that do not exist.
For example, consider this cast:
```cc
auto* x = dynamic_cast<T*>(y);
```
The Rust equivalent of this must look up, at runtime, the offset of T within Y. That lookup function for finding the offset doesn't exist and doesn't have an existing item, we'd need to make a new C++ function to implement the cast. (Once per pair of base/derived class.)
PiperOrigin-RevId: 444689438
1 file changed