@@ -127,16 +127,16 @@ pub(crate) mod private {
127127 }
128128}
129129
130- impl < ' py , T : PyTypeCheck > IntoPyObject < ' py > for Bound < ' py , T > {
130+ impl < ' py , T : PyTypeCheck > IntoPyObject < ' py > for Bound < ' _ , T > {
131131 type Target = T ;
132132 type Output = Bound < ' py , Self :: Target > ;
133133 type Error = Infallible ;
134134
135135 #[ cfg( feature = "experimental-inspect" ) ]
136136 const OUTPUT_TYPE : PyStaticExpr = T :: TYPE_HINT ;
137137
138- fn into_pyobject ( self , _py : Python < ' py > ) -> Result < Self :: Output , Self :: Error > {
139- Ok ( self )
138+ fn into_pyobject ( self , py : Python < ' py > ) -> Result < Self :: Output , Self :: Error > {
139+ Ok ( self . unbind ( ) . into_bound ( py ) )
140140 }
141141}
142142
@@ -148,8 +148,8 @@ impl<'a, 'py, T: PyTypeCheck> IntoPyObject<'py> for &'a Bound<'py, T> {
148148 #[ cfg( feature = "experimental-inspect" ) ]
149149 const OUTPUT_TYPE : PyStaticExpr = T :: TYPE_HINT ;
150150
151- fn into_pyobject ( self , _py : Python < ' py > ) -> Result < Self :: Output , Self :: Error > {
152- Ok ( self . as_borrowed ( ) )
151+ fn into_pyobject ( self , py : Python < ' py > ) -> Result < Self :: Output , Self :: Error > {
152+ Ok ( self . as_unbound ( ) . bind_borrowed ( py ) )
153153 }
154154}
155155
@@ -161,8 +161,8 @@ impl<'a, 'py, T: PyTypeCheck> IntoPyObject<'py> for Borrowed<'a, 'py, T> {
161161 #[ cfg( feature = "experimental-inspect" ) ]
162162 const OUTPUT_TYPE : PyStaticExpr = T :: TYPE_HINT ;
163163
164- fn into_pyobject ( self , _py : Python < ' py > ) -> Result < Self :: Output , Self :: Error > {
165- Ok ( self )
164+ fn into_pyobject ( self , py : Python < ' py > ) -> Result < Self :: Output , Self :: Error > {
165+ Ok ( self . as_unbound ( ) . bind_borrowed ( py ) )
166166 }
167167}
168168
@@ -174,8 +174,8 @@ impl<'a, 'py, T: PyTypeCheck> IntoPyObject<'py> for &Borrowed<'a, 'py, T> {
174174 #[ cfg( feature = "experimental-inspect" ) ]
175175 const OUTPUT_TYPE : PyStaticExpr = T :: TYPE_HINT ;
176176
177- fn into_pyobject ( self , _py : Python < ' py > ) -> Result < Self :: Output , Self :: Error > {
178- Ok ( * self )
177+ fn into_pyobject ( self , py : Python < ' py > ) -> Result < Self :: Output , Self :: Error > {
178+ Ok ( self . as_unbound ( ) . bind_borrowed ( py ) )
179179 }
180180}
181181
0 commit comments