commit | 7003909c1451352974397beda9119991a9507b02 | [log] [tgz] |
---|---|---|
author | Devin Jeanpierre <jeanpierreda@google.com> | Fri Aug 05 04:05:15 2022 -0700 |
committer | Copybara-Service <copybara-worker@google.com> | Fri Aug 05 04:05:48 2022 -0700 |
tree | 8b6604767a75b80f67f26e0ed670a3a7f712df4f | |
parent | 8e54c2ff8da22efe19205fa08ed971b41d4e57dc [diff] |
Partial and hacky fix for ElaboratedType-related errors. This really is my best short right now! I tried being cleverer with how each case handles desugaring, but, for example, one problem I think I am running into is that they generally expect to fully desugar all the way past all sugar nodes, but the nodes we're casting are themselves sugar nodes -- so they skip past both the ElaboratedType and the very node they were meant to match. (Where, before, as a special-case, they matched the node because it wasn't nested inside other sugar.) (Or in other cases I just seriously don't understand why `getAs`/`getAsAdjusted` don't do what I expect, to be honest. Presumably something like "The Canonical type isn't what I expect"...) This doesn't fix all tests; I do not currently understand why this happens: ``` thread 'test_incomplete_record_has_rs_name' panicked at 'input unexpectedly didn't match the pattern: expected '"test_namespace_bindings::MyTemplate<test_namespace_bindings::Param>"' but got '"test_namespace_bindings::MyTemplate<Param>"' ``` It could be that these are coincidental? There are other differences in the AST: https://godbolt.org/z/WsvKjzG6Y (e.g. `TemplateSpecializationType 'MyTemplate<Type>' sugar MyTemplate` vs `TemplateSpecializationType 'MyTemplate<ns::Type>' sugar MyTemplate`.) I'd need to dig more. But for now, at least opting for fixing a subset of tests and getting help fixing the rest... My brain tired. PiperOrigin-RevId: 465531292
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