Skip to content

Support Rust-movable, C++ non-movable types in StatusOr via UnsafeRelocateTag. - #1934

Open
copybara-service[bot] wants to merge 1 commit into
mainfrom
test_974770314
Open

copybara-service[bot] wants to merge 1 commit into
mainfrom
test_974770314

Conversation

@copybara-service

@copybara-service copybara-service Bot commented Sep 1, 2026

Copy link
Copy Markdown

Support Rust-movable, C++ non-movable types in StatusOr via UnsafeRelocateTag.

  • Define UnsafeRelocateTag in a shared header support/unsafe_relocate_tag.h.
  • Make proto::Rust (proto2::Rust) non-movable in C++ to preserve its non-null invariant, and add an UnsafeRelocateTag constructor for destructive relocation.
  • Add an UnsafeRelocateTag constructor to absl::StatusOr when T supports UnsafeRelocateTag.
  • Test that Vec and NewStatusOr bind cleanly as rs_std::Vec<proto::Rust> and absl::StatusOr<proto::Rust> in C++.

@copybara-service copybara-service Bot changed the title Make proto::Rust<T> non-movable in C++ to preserve non-null invariant. Support Rust-movable, C++ non-movable types in StatusOr via UnsafeRelocateTag. Sep 2, 2026
@copybara-service
copybara-service Bot force-pushed the test_974770314 branch 5 times, most recently from 7c95427 to 861cc2a Compare September 3, 2026 00:24
…ocateTag.

- Define UnsafeRelocateTag in a shared header support/unsafe_relocate_tag.h.
- Make proto::Rust<T> (proto2::Rust<T>) non-movable in C++ to preserve its non-null invariant, and add an UnsafeRelocateTag constructor for destructive relocation.
- Add an UnsafeRelocateTag constructor to absl::StatusOr<T> when T supports UnsafeRelocateTag.
- Test that Vec<MessageType> and NewStatusOr<MessageType> bind cleanly as rs_std::Vec<proto::Rust<MessageType>> and absl::StatusOr<proto::Rust<MessageType>> in C++.

PiperOrigin-RevId: 974770314
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant