Delete `RcEq<T>` and instead provide `impl PartialEq for RsSnippet`.

`salsa` requires that all query keys and query results can be compared
for equality.  Key equality is needed for basic `salsa` functionality
(memoization of previous computations).  Result equality is needed to
determine that a changed input doesn't affect the result of a given
computation (and therefore computations transitively depending on the
result don't need to be redone).

Before this CL, equality of some query results was provided by `RcEq<T>`
in Crubit's `salsa_utils.rs` (inspired by Chalk's `ArcEq`).  This worked
but pointer-based-equality would unnecessary treat equivalent results as
different.  This doesn't matter in practice, because Crubit never
resets `salsa` inputs (i.e. only calls `set_ir` once) and so `salsa`
would never need to check equality of `RcEq`.  Still, having real,
non-pointer-based equality should help with incremental computations
in the future (if they ever become used by Crubit).  And deleting
`salsa_utils.rs` also means the code is smaller and easier to
understand.

PiperOrigin-RevId: 476146950
3 files changed
tree: a98001ba0a2082bc7261ab807217b4b8a382bf3b
  1. .bazelci/
  2. bazel/
  3. cc_bindings_from_rs/
  4. cc_template/
  5. common/
  6. docs/
  7. lifetime_analysis/
  8. lifetime_annotations/
  9. migrator/
  10. nullability_verification/
  11. rs_bindings_from_cc/
  12. .bazelrc
  13. .gitignore
  14. BUILD
  15. Cargo.Bazel.lock
  16. CODE_OF_CONDUCT
  17. CONTRIBUTING
  18. LICENSE
  19. README.md
  20. WORKSPACE
README.md

Crubit: C++/Rust Bidirectional Interop Tool

Build status

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.

Building Crubit

$ 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

Using a prebuilt LLVM tree

$ 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