Implement sound `Drop` support in our little pin_project alternative.

Unlike `pin_project`, the function is just marked unsafe to make it sound (as it's not safe to drop a struct). This is maybe a slight ergonomic hit, but for the most part we don't expect people to implement this manually -- in the near term, it's only going to be autogenerated as part of bindings generation. Also, it's not _that_ bad. Worst case, we could define a macro much like `pin_project` does, to make it look like you're defining a safe function.

Otherwise, this follows relatively closely with the approach described in https://docs.rs/pin-project/latest/pin_project/attr.pin_project.html#safety

After this CL, the pin projection implemented here should be sound, without safety holes that would allow UB in safe code. Followup CLs will actually start using this in interop, so that we can use the `ctor!()` macro.

---

Error scenarios and their error messages, tested by hand:

defined PinnedDrop without PinnedDrop enabled:

```
error[E0119]: conflicting implementations of trait `ctor::PinnedDrop` for type `test_pinned_drop::DropStruct`
   --> third_party/crubit/rs_bindings_from_cc/support/ctor_proc_macros_test.rs:201:5
    |
201 |     #[::ctor::recursively_pinned]
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `test_pinned_drop::DropStruct`
202 |     struct DropStruct(Rc<Cell<bool>>);
203 |     impl ::ctor::PinnedDrop for DropStruct {
    |     -------------------------------------- first implementation here
    |
    = note: this error originates in the attribute macro `::ctor::recursively_pinned` (in Nightly builds, run with -Z macro-backtrace for more info)
```

forgot to define PinnedDrop, with PinnedDrop enabled:

```
error[E0277]: the trait bound `DropStruct: PinnedDrop` is not satisfied
   --> third_party/crubit/rs_bindings_from_cc/support/ctor_proc_macros_test.rs:201:5
    |
201 |     #[::ctor::recursively_pinned(PinnedDrop)]
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `PinnedDrop` is not implemented for `DropStruct`
    |
    = help: the following other types implement trait `PinnedDrop`:
            ...
    = note: this error originates in the attribute macro `::ctor::recursively_pinned` (in Nightly builds, run with -Z macro-backtrace for more info)
```

defined Drop (without PinnedDrop enabled)

```
error[E0119]: conflicting implementations of trait `ctor::macro_internal::DoNotImplDrop` for type `test_pinned_drop::DropStruct`
   --> third_party/crubit/rs_bindings_from_cc/support/ctor_proc_macros_test.rs:201:5
    |
201 |     #[::ctor::recursively_pinned]
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: conflicting implementation in crate `ctor`:
            - impl<T> DoNotImplDrop for T
              where T: Drop;
    = note: this error originates in the attribute macro `::ctor::recursively_pinned` (in Nightly builds, run with -Z macro-backtrace for more info)
```

defined Drop (*with* PinnedDrop enabled), instead of PinnedDrop:

```
error[E0119]: conflicting implementations of trait `std::ops::Drop` for type `test_pinned_drop::DropStruct`
   --> third_party/crubit/rs_bindings_from_cc/support/ctor_proc_macros_test.rs:201:5
    |
201 |     #[::ctor::recursively_pinned(PinnedDrop)]
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `test_pinned_drop::DropStruct`
...
208 |     impl Drop for DropStruct {
    |     ------------------------ first implementation here
    |
    = note: this error originates in the attribute macro `::ctor::recursively_pinned` (in Nightly builds, run with -Z macro-backtrace for more info)
```

PiperOrigin-RevId: 447860359
3 files changed
tree: ed7274bf6c0eb799dac0474b09572290c9cd4e64
  1. cc_template/
  2. common/
  3. docs/
  4. lifetime_annotations/
  5. migrator/
  6. rs_bindings_from_cc/
  7. BUILD
  8. CODE_OF_CONDUCT
  9. CONTRIBUTING
  10. LICENSE
  11. 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 take us. There will be breaking changes without warning. Unfortunately, we can't take contributions at this point.