@@ -127,55 +127,55 @@ 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
143- impl < ' a , ' py , T : PyTypeCheck > IntoPyObject < ' py > for & ' a Bound < ' py , T > {
143+ impl < ' a , ' py , T : PyTypeCheck > IntoPyObject < ' py > for & ' a Bound < ' _ , T > {
144144 type Target = T ;
145145 type Output = Borrowed < ' a , ' py , Self :: Target > ;
146146 type Error = Infallible ;
147147
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
156- impl < ' a , ' py , T : PyTypeCheck > IntoPyObject < ' py > for Borrowed < ' a , ' py , T > {
156+ impl < ' a , ' py , T : PyTypeCheck > IntoPyObject < ' py > for Borrowed < ' a , ' _ , T > {
157157 type Target = T ;
158158 type Output = Borrowed < ' a , ' py , Self :: Target > ;
159159 type Error = Infallible ;
160160
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
169- impl < ' a , ' py , T : PyTypeCheck > IntoPyObject < ' py > for & Borrowed < ' a , ' py , T > {
169+ impl < ' a , ' py , T : PyTypeCheck > IntoPyObject < ' py > for & Borrowed < ' a , ' _ , T > {
170170 type Target = T ;
171171 type Output = Borrowed < ' a , ' py , Self :: Target > ;
172172 type Error = Infallible ;
173173
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