@@ -15,8 +15,8 @@ use rustc_ast::ast::LitKind;
1515use rustc_errors:: Applicability ;
1616use rustc_hir:: def:: CtorKind ;
1717use rustc_hir:: {
18- print , Arm , BindingAnnotation , Block , BorrowKind , Expr , ExprKind , Local , MatchSource , Mutability , Node , Pat ,
19- PatKind , QPath , RangeEnd ,
18+ Arm , BindingAnnotation , Block , BorrowKind , Expr , ExprKind , Local , MatchSource , Mutability , Node , Pat , PatKind ,
19+ QPath , RangeEnd ,
2020} ;
2121use rustc_lint:: { LateContext , LateLintPass , LintContext } ;
2222use rustc_session:: { declare_tool_lint, impl_lint_pass} ;
@@ -536,10 +536,12 @@ fn check_single_match_opt_like(
536536 if !inner. iter ( ) . all ( is_wild) {
537537 return ;
538538 }
539- print :: to_string ( print :: NO_ANN , |s| s. print_qpath ( path, false ) )
539+ rustc_hir_pretty :: to_string ( rustc_hir_pretty :: NO_ANN , |s| s. print_qpath ( path, false ) )
540540 } ,
541541 PatKind :: Binding ( BindingAnnotation :: Unannotated , .., ident, None ) => ident. to_string ( ) ,
542- PatKind :: Path ( ref path) => print:: to_string ( print:: NO_ANN , |s| s. print_qpath ( path, false ) ) ,
542+ PatKind :: Path ( ref path) => {
543+ rustc_hir_pretty:: to_string ( rustc_hir_pretty:: NO_ANN , |s| s. print_qpath ( path, false ) )
544+ } ,
543545 _ => return ,
544546 } ;
545547
@@ -638,7 +640,7 @@ fn check_wild_err_arm(cx: &LateContext<'_, '_>, ex: &Expr<'_>, arms: &[Arm<'_>])
638640 if match_type ( cx, ex_ty, & paths:: RESULT ) {
639641 for arm in arms {
640642 if let PatKind :: TupleStruct ( ref path, ref inner, _) = arm. pat . kind {
641- let path_str = print :: to_string ( print :: NO_ANN , |s| s. print_qpath ( path, false ) ) ;
643+ let path_str = rustc_hir_pretty :: to_string ( rustc_hir_pretty :: NO_ANN , |s| s. print_qpath ( path, false ) ) ;
642644 if path_str == "Err" {
643645 let mut matching_wild = inner. iter ( ) . any ( is_wild) ;
644646 let mut ident_bind_name = String :: from ( "_" ) ;
0 commit comments