@@ -19,7 +19,7 @@ use rustc_errors::Applicability;
19
19
use rustc_hir:: {
20
20
def_id:: LocalDefId ,
21
21
intravisit:: { walk_expr, FnKind , Visitor } ,
22
- BindingAnnotation , Body , ByRef , Expr , ExprKind , FnDecl , HirId , Node , Pat , PatKind , UnOp ,
22
+ BindingMode , Body , ByRef , Expr , ExprKind , FnDecl , HirId , Node , Pat , PatKind , UnOp ,
23
23
} ;
24
24
use rustc_lint:: { LateContext , LateLintPass } ;
25
25
use rustc_middle:: ty:: { self , adjustment:: Adjust } ;
@@ -121,7 +121,7 @@ impl<'tcx> LateLintPass<'tcx> for SuboptimalPattern {
121
121
let ( referent_ty, n_refs) = peel_mid_ty_refs ( pat_ty) ;
122
122
123
123
if let ty:: Tuple ( tys) = referent_ty. kind ( )
124
- && let PatKind :: Binding ( BindingAnnotation ( ByRef :: No , _) , hir_id, ident, None ) =
124
+ && let PatKind :: Binding ( BindingMode ( ByRef :: No , _) , hir_id, ident, None ) =
125
125
pat. kind
126
126
&& let Some ( projections) = exclusively_projected ( cx. tcx , hir_id, body. value )
127
127
{
@@ -253,10 +253,10 @@ fn collect_non_ref_idents(pat: &Pat<'_>) -> Option<FxHashSet<HirId>> {
253
253
pat. walk ( |pat| {
254
254
if let PatKind :: Binding ( annotation, _, _, _) = pat. kind {
255
255
match annotation {
256
- BindingAnnotation ( ByRef :: No , _) => {
256
+ BindingMode ( ByRef :: No , _) => {
257
257
hir_ids. as_mut ( ) . map ( |hir_ids| hir_ids. insert ( pat. hir_id ) ) ;
258
258
}
259
- BindingAnnotation ( ByRef :: Yes ( _) , _) => {
259
+ BindingMode ( ByRef :: Yes ( _) , _) => {
260
260
hir_ids = None ;
261
261
}
262
262
}
0 commit comments