Implement `!Unpin` move constructors.
This very nearly is as simple as just adding && to the IR. The other necessary change was to
use `std::forward` to propagate rvalue references in thunks. (Thanks sbenza@ for giving me the exact form that
would also work for non-reference types! I was about to write my own forward function...)
(The remaining changes are just goldens/tests.)
However, a followup CL is needed to make move constructors actually usable for `Unpin` types -- they can't just call `From<RvalueReference>` because they can't create an `RvalueReference`.
Similarly, while this creates bindings for functions that take or return rvalue reference parameters, they aren't as useful as they could be.
PiperOrigin-RevId: 437970361
diff --git a/rs_bindings_from_cc/support/ctor.rs b/rs_bindings_from_cc/support/ctor.rs
index f54262c..350e52c 100644
--- a/rs_bindings_from_cc/support/ctor.rs
+++ b/rs_bindings_from_cc/support/ctor.rs
@@ -213,6 +213,7 @@
// DerefMut based move construction
// ================================
+#[repr(transparent)]
pub struct RvalueReference<'a, T>(Pin<&'a mut T>);
impl<T> RvalueReference<'_, T> {
@@ -263,6 +264,7 @@
/// !Unpin to override the blanket Ctor impl.
impl<P> !Unpin for Move<P> {}
+#[repr(transparent)]
pub struct ConstRvalueReference<'a, T>(&'a T);
impl<'a, T> ConstRvalueReference<'a, T> {