@@ -259,22 +259,21 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
259259 /// The `cause_span` should be the span that caused us to
260260 /// have this expected signature, or `None` if we can't readily
261261 /// know that.
262+ #[ instrument( level = "debug" , skip( self , cause_span) ) ]
262263 fn deduce_sig_from_projection (
263264 & self ,
264265 cause_span : Option < Span > ,
265266 projection : ty:: PolyProjectionPredicate < ' tcx > ,
266267 ) -> Option < ExpectedSig < ' tcx > > {
267268 let tcx = self . tcx ;
268269
269- debug ! ( "deduce_sig_from_projection({:?})" , projection) ;
270-
271270 let trait_def_id = projection. trait_def_id ( tcx) ;
272271
273272 let is_fn = tcx. fn_trait_kind_from_lang_item ( trait_def_id) . is_some ( ) ;
274273 let gen_trait = tcx. require_lang_item ( LangItem :: Generator , cause_span) ;
275274 let is_gen = gen_trait == trait_def_id;
276275 if !is_fn && !is_gen {
277- debug ! ( "deduce_sig_from_projection: not fn or generator" ) ;
276+ debug ! ( "not fn or generator" ) ;
278277 return None ;
279278 }
280279
@@ -283,15 +282,15 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
283282 // associated item and not yield.
284283 let return_assoc_item = self . tcx . associated_item_def_ids ( gen_trait) [ 1 ] ;
285284 if return_assoc_item != projection. projection_def_id ( ) {
286- debug ! ( "deduce_sig_from_projection: not return assoc item of generator" ) ;
285+ debug ! ( "not return assoc item of generator" ) ;
287286 return None ;
288287 }
289288 }
290289
291290 let input_tys = if is_fn {
292291 let arg_param_ty = projection. skip_binder ( ) . projection_ty . substs . type_at ( 1 ) ;
293292 let arg_param_ty = self . resolve_vars_if_possible ( arg_param_ty) ;
294- debug ! ( "deduce_sig_from_projection: arg_param_ty={:?}" , arg_param_ty) ;
293+ debug ! ( ? arg_param_ty) ;
295294
296295 match arg_param_ty. kind ( ) {
297296 ty:: Tuple ( tys) => tys. into_iter ( ) . map ( |k| k. expect_ty ( ) ) . collect :: < Vec < _ > > ( ) ,
@@ -306,7 +305,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
306305 // Since this is a return parameter type it is safe to unwrap.
307306 let ret_param_ty = projection. skip_binder ( ) . term . ty ( ) . unwrap ( ) ;
308307 let ret_param_ty = self . resolve_vars_if_possible ( ret_param_ty) ;
309- debug ! ( "deduce_sig_from_projection: ret_param_ty={:?}" , ret_param_ty) ;
308+ debug ! ( ? ret_param_ty) ;
310309
311310 let sig = projection. rebind ( self . tcx . mk_fn_sig (
312311 input_tys. iter ( ) ,
@@ -315,7 +314,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
315314 hir:: Unsafety :: Normal ,
316315 Abi :: Rust ,
317316 ) ) ;
318- debug ! ( "deduce_sig_from_projection: sig={:?}" , sig) ;
317+ debug ! ( ? sig) ;
319318
320319 Some ( ExpectedSig { cause_span, sig } )
321320 }
0 commit comments