bazel /
crubit /
97140a952a519caeee3967b2a59ff69d245c5dfc Split `Reconstruct` trait into two: a safe trait that's unsafe to call, and an unsafe trait that's safe to call.
(That's maybe a mouthful, but the idea is that one trait has the caller guarantee correctness, and the other has the implementor guarantee it.)
This resolves concerns around base classes: non-final classes will not implement the trait that is safe to call, because it is UB to reconstruct a base class subobject.
This also pretty solidly puts `reconstruct` in the territory of "(perhaps) useful, but not the thing you use by default", at least not unless we can get better UB-guarantees from clang. (For example, if we defined behaviour for all non-polymorphic base classes, we're getting closer to general utility!)
Huge thanks to both richardsmith@ and lexer@ for pointing out this particular usability issue, which I didn't appreciate at the time of writing.
PiperOrigin-RevId: 435668831
1 file changed
tree: 11bb3c6ed3aab6175dc32c10cb997418c81eac94
- 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 pull us. There will be breaking changes without warning. Unfortunately, we can't take contributions at this point.