commit | e77fa7eebe4ec0fd2a43ed778db48d1a7d4ed749 | [log] [tgz] |
---|---|---|
author | Devin Jeanpierre <jeanpierreda@google.com> | Thu Jun 02 14:05:58 2022 -0700 |
committer | Copybara-Service <copybara-worker@google.com> | Thu Jun 02 14:06:28 2022 -0700 |
tree | 7cfbfd9135d2dcd6a47ea1594d186433419eca38 | |
parent | 2469a5e5ce23a28e5358df2ae887de1e4ec6ecdb [diff] |
Automatically determine which lifetimes to declare in `impl` vs `fn`. The problem with `declare_lifetimes` is that it's all-or-nothing -- either everything is a lifetime parameter of the `impl`, or of the `fn`. And so `declare_lifetimes: true` works for static functions, but not instance functions where _some_ lifetime parameters are on the `fn` (e.g. for `&self`), and others on the trait. To do this requires structuring the trait names: rather than an opaque bag of tokens, it is a name + parameters. This feels like a good change, structure is good! And it allows us to do things like automatically determine which lifetimes must be parameters on the `impl` block. :) PiperOrigin-RevId: 452617483
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 -DCMAKE_INSTALL_PREFIX=install $ cmake --build build -j $ # wait... $ cmake --install build $ cd ../crubit $ LLVM_INSTALL_PATH=../llvm-project/install bazel build //rs_bindings_from_cc:rs_bindings_from_cc_impl