Work around Rust's impl/lifetime system using a `Captures` trait.
See https://github.com/rust-lang/rust/issues/61756 and the comments here.
PiperOrigin-RevId: 461149995
diff --git a/rs_bindings_from_cc/test/golden/bitfields_rs_api.rs b/rs_bindings_from_cc/test/golden/bitfields_rs_api.rs
index 110ca00..783aecd 100644
--- a/rs_bindings_from_cc/test/golden/bitfields_rs_api.rs
+++ b/rs_bindings_from_cc/test/golden/bitfields_rs_api.rs
@@ -55,7 +55,7 @@
}
impl<'b> ::ctor::CtorNew<&'b crate::WithBitfields> for WithBitfields {
- type CtorType = impl ::ctor::Ctor<Output = Self> + 'b;
+ type CtorType = impl ::ctor::Ctor<Output = Self> + ::ctor::Captures<'b>;
#[inline(always)]
fn ctor_new(args: &'b crate::WithBitfields) -> Self::CtorType {
let __param_0 = args;
@@ -70,7 +70,7 @@
}
}
impl<'b> ::ctor::CtorNew<(&'b crate::WithBitfields,)> for WithBitfields {
- type CtorType = impl ::ctor::Ctor<Output = Self> + 'b;
+ type CtorType = impl ::ctor::Ctor<Output = Self> + ::ctor::Captures<'b>;
#[inline(always)]
fn ctor_new(args: (&'b crate::WithBitfields,)) -> Self::CtorType {
let (arg,) = args;
@@ -79,7 +79,7 @@
}
impl<'b> ::ctor::CtorNew<::ctor::RvalueReference<'b, crate::WithBitfields>> for WithBitfields {
- type CtorType = impl ::ctor::Ctor<Output = Self> + 'b;
+ type CtorType = impl ::ctor::Ctor<Output = Self> + ::ctor::Captures<'b>;
#[inline(always)]
fn ctor_new(args: ::ctor::RvalueReference<'b, crate::WithBitfields>) -> Self::CtorType {
let __param_0 = args;
@@ -94,7 +94,7 @@
}
}
impl<'b> ::ctor::CtorNew<(::ctor::RvalueReference<'b, crate::WithBitfields>,)> for WithBitfields {
- type CtorType = impl ::ctor::Ctor<Output = Self> + 'b;
+ type CtorType = impl ::ctor::Ctor<Output = Self> + ::ctor::Captures<'b>;
#[inline(always)]
fn ctor_new(args: (::ctor::RvalueReference<'b, crate::WithBitfields>,)) -> Self::CtorType {
let (arg,) = args;