Reduce the scope of what PointeeType() is intended to do.

I originally thought it would be useful to make this handle _any_ reference-like
type (which would, for example, include types that have lifetime parameters),
but we never ended up using it in this way.

However, it's become clear that it's useful for a slightly different purpose:
Retrieve the pointee type if the input type is a pointer or reference type, but
not in any other case. The other cases we want to exclude include
pointers-to-members, which do have a pointee type but are otherwise quite
different from normal pointers in that we don't associate them with lifetimes.

The modified PointeeType() will come in useful for making sure we handle
pointers-to-members correctly (which will happen in a followup CL). Essentially,
all that this will require is replacing the currently widespread use of
Type::getPointeeType() with PointeeType().

As part of simplifying PointeeType(), we remove the type canonicalization.
Again, I originally thought this would be useful, but it turns out it's
counterproductive for the purposes we now want to use it for.

PiperOrigin-RevId: 432419108
2 files changed
tree: 78281310e70bdb142845ebb23232e4edda5c02ae
  1. lifetime_annotations/
  2. rs_bindings_from_cc/
  3. CODE_OF_CONDUCT
  4. CONTRIBUTING
  5. LICENSE
  6. 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.