@@ -7,7 +7,7 @@ use rustc_ast::LitIntType;
77use rustc_data_structures:: fx:: FxHashMap ;
88use rustc_hir as hir;
99use rustc_hir:: {
10- ArrayLen , BindingAnnotation , Closure , ExprKind , FnRetTy , HirId , Lit , PatKind , QPath , StmtKind , TyKind ,
10+ ArrayLen , BindingAnnotation , Closure , ExprKind , FnRetTy , HirId , Lit , PatKind , QPath , StmtKind , TyKind , CaptureBy
1111} ;
1212use rustc_lint:: { LateContext , LateLintPass , LintContext } ;
1313use rustc_session:: declare_lint_pass;
@@ -479,6 +479,11 @@ impl<'a, 'tcx> PrintVisitor<'a, 'tcx> {
479479 movability,
480480 ..
481481 } ) => {
482+ let capture_clause = match capture_clause {
483+ CaptureBy :: Value { .. } => "Value { .. }" ,
484+ CaptureBy :: Ref => "Ref" ,
485+ } ;
486+
482487 let movability = OptionPat :: new ( movability. map ( |m| format ! ( "Movability::{m:?}" ) ) ) ;
483488
484489 let ret_ty = match fn_decl. output {
@@ -487,7 +492,7 @@ impl<'a, 'tcx> PrintVisitor<'a, 'tcx> {
487492 } ;
488493
489494 bind ! ( self , fn_decl, body_id) ;
490- kind ! ( "Closure(CaptureBy::{capture_clause:? }, {fn_decl}, {body_id}, _, {movability})" ) ;
495+ kind ! ( "Closure(CaptureBy::{capture_clause}, {fn_decl}, {body_id}, _, {movability})" ) ;
491496 chain ! ( self , "let {ret_ty} = {fn_decl}.output" ) ;
492497 self . body ( body_id) ;
493498 } ,
0 commit comments