@@ -15,8 +15,8 @@ use rustc_ast::ast::LitKind;
15
15
use rustc_errors:: Applicability ;
16
16
use rustc_hir:: def:: CtorKind ;
17
17
use 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 ,
20
20
} ;
21
21
use rustc_lint:: { LateContext , LateLintPass , LintContext } ;
22
22
use rustc_session:: { declare_tool_lint, impl_lint_pass} ;
@@ -536,10 +536,12 @@ fn check_single_match_opt_like(
536
536
if !inner. iter ( ) . all ( is_wild) {
537
537
return ;
538
538
}
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 ) )
540
540
} ,
541
541
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
+ } ,
543
545
_ => return ,
544
546
} ;
545
547
@@ -638,7 +640,7 @@ fn check_wild_err_arm(cx: &LateContext<'_, '_>, ex: &Expr<'_>, arms: &[Arm<'_>])
638
640
if match_type ( cx, ex_ty, & paths:: RESULT ) {
639
641
for arm in arms {
640
642
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 ) ) ;
642
644
if path_str == "Err" {
643
645
let mut matching_wild = inner. iter ( ) . any ( is_wild) ;
644
646
let mut ident_bind_name = String :: from ( "_" ) ;
0 commit comments