@@ -2,7 +2,6 @@ use crate::def::{CtorOf, DefKind, Res};
22use crate :: def_id:: DefId ;
33use crate :: hir:: { self , HirId , PatKind } ;
44use rustc_span:: symbol:: Ident ;
5- use rustc_span:: Span ;
65
76use std:: iter:: { Enumerate , ExactSizeIterator } ;
87
@@ -79,10 +78,10 @@ impl hir::Pat<'_> {
7978
8079 /// Call `f` on every "binding" in a pattern, e.g., on `a` in
8180 /// `match foo() { Some(a) => (), None => () }`
82- pub fn each_binding ( & self , mut f : impl FnMut ( hir:: BindingAnnotation , HirId , Span , Ident ) ) {
81+ pub fn each_binding ( & self , mut f : impl FnMut ( hir:: BindingAnnotation , HirId , Ident ) ) {
8382 self . walk_always ( |p| {
8483 if let PatKind :: Binding ( binding_mode, _, ident, _) = p. kind {
85- f ( binding_mode, p. hir_id , p . span , ident) ;
84+ f ( binding_mode, p. hir_id , ident) ;
8685 }
8786 } ) ;
8887 }
@@ -91,17 +90,14 @@ impl hir::Pat<'_> {
9190 /// `match foo() { Some(a) => (), None => () }`.
9291 ///
9392 /// When encountering an or-pattern `p_0 | ... | p_n` only `p_0` will be visited.
94- pub fn each_binding_or_first (
95- & self ,
96- f : & mut impl FnMut ( hir:: BindingAnnotation , HirId , Span , Ident ) ,
97- ) {
93+ pub fn each_binding_or_first ( & self , f : & mut impl FnMut ( hir:: BindingAnnotation , HirId , Ident ) ) {
9894 self . walk ( |p| match & p. kind {
9995 PatKind :: Or ( ps) => {
10096 ps[ 0 ] . each_binding_or_first ( f) ;
10197 false
10298 }
10399 PatKind :: Binding ( bm, _, ident, _) => {
104- f ( * bm, p. hir_id , p . span , * ident) ;
100+ f ( * bm, p. hir_id , * ident) ;
105101 true
106102 }
107103 _ => true ,
@@ -181,7 +177,7 @@ impl hir::Pat<'_> {
181177 // ref bindings are be implicit after #42640 (default match binding modes). See issue #44848.
182178 pub fn contains_explicit_ref_binding ( & self ) -> Option < hir:: Mutability > {
183179 let mut result = None ;
184- self . each_binding ( |annotation, _, _, _ | match annotation {
180+ self . each_binding ( |annotation, _, _| match annotation {
185181 hir:: BindingAnnotation :: Ref => match result {
186182 None | Some ( hir:: Mutability :: Not ) => result = Some ( hir:: Mutability :: Not ) ,
187183 _ => { }
0 commit comments