commit | 7b075e3f8fcd88ceeca045eaf4c0a6734ecacfef | [log] [tgz] |
---|---|---|
author | Marcel Hlopko <hlopko@google.com> | Fri May 27 01:47:56 2022 -0700 |
committer | Copybara-Service <copybara-worker@google.com> | Fri May 27 01:48:24 2022 -0700 |
tree | df01ac1e4cf33999f44db55e0851eda686731353 | |
parent | d7d68f059e6bf5b795961482b3047a7c675e998a [diff] |
Do not import abstract classes Right now Crubit generates C++ thunks for instantiating a type, for example: ``` extern "C" void __rust_thunk___Foo1234_(class Foo* __this, const class Foo& __param_0) { crubit::construct_at(std::forward<decltype(__this)>(__this), std::forward<decltype(__param_0)>(__param_0)); } ``` Abstract classes cannot be instantiated (`error: allocating an object of abstract class type`). Instead of fixing that I decided (since it's currently higher priority for me to fix crashes and false positives than increasing coverage) to temporarily disable generating bindings for abstract classes (classes having a pure virtual method). This CL does not touch non-abstract classes, with or without virtual methods. PiperOrigin-RevId: 451336767
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.
$ apt install clang lld bazel $ git clone git@github.com:google/crubit.git $ cd crubit $ bazel build --linkopt=-fuse-ld=/usr/bin/ld.lld //rs_bindings_from_cc:rs_bindings_from_cc_impl
$ git clone https://github.com/llvm/llvm-project $ cd llvm-project $ CC=clang CXX=clang++ cmake -S llvm -B build -DLLVM_ENABLE_PROJECTS='clang' -DCMAKE_BUILD_TYPE=Release $ cmake --build build -j $ # wait... $ cd ../crubit $ PREBUILT_LLVM_PATH=../llvm-project bazel build //rs_bindings_from_cc:rs_bindings_from_cc_impl