@@ -100,23 +100,6 @@ impl<'tcx> Visitor<'tcx> for FindNestedTypeVisitor<'tcx> {
100100 // the lifetime of the TyRptr
101101 let hir_id = lifetime. hir_id ;
102102 match ( self . tcx . named_region ( hir_id) , self . bound_region ) {
103- // Find the index of the anonymous region that was part of the
104- // error. We will then search the function parameters for a bound
105- // region at the right depth with the same index
106- (
107- Some ( rl:: Region :: LateBoundAnon ( debruijn_index, _, anon_index) ) ,
108- ty:: BrAnon ( br_index) ,
109- ) => {
110- debug ! (
111- "LateBoundAnon depth = {:?} anon_index = {:?} br_index={:?}" ,
112- debruijn_index, anon_index, br_index
113- ) ;
114- if debruijn_index == self . current_index && anon_index == br_index {
115- self . found_type = Some ( arg) ;
116- return ; // we can stop visiting now
117- }
118- }
119-
120103 // Find the index of the named region that was part of the
121104 // error. We will then search the function parameters for a bound
122105 // region at the right depth with the same index
@@ -151,8 +134,7 @@ impl<'tcx> Visitor<'tcx> for FindNestedTypeVisitor<'tcx> {
151134 rl:: Region :: Static
152135 | rl:: Region :: Free ( _, _)
153136 | rl:: Region :: EarlyBound ( _, _)
154- | rl:: Region :: LateBound ( _, _, _)
155- | rl:: Region :: LateBoundAnon ( _, _, _) ,
137+ | rl:: Region :: LateBound ( _, _, _) ,
156138 )
157139 | None ,
158140 _,
@@ -206,16 +188,6 @@ impl<'tcx> Visitor<'tcx> for TyPathVisitor<'tcx> {
206188 fn visit_lifetime ( & mut self , lifetime : & hir:: Lifetime ) {
207189 match ( self . tcx . named_region ( lifetime. hir_id ) , self . bound_region ) {
208190 // the lifetime of the TyPath!
209- (
210- Some ( rl:: Region :: LateBoundAnon ( debruijn_index, _, anon_index) ) ,
211- ty:: BrAnon ( br_index) ,
212- ) => {
213- if debruijn_index == self . current_index && anon_index == br_index {
214- self . found_it = true ;
215- return ;
216- }
217- }
218-
219191 ( Some ( rl:: Region :: EarlyBound ( _, id) ) , ty:: BrNamed ( def_id, _) ) => {
220192 debug ! ( "EarlyBound id={:?} def_id={:?}" , id, def_id) ;
221193 if id == def_id {
@@ -239,7 +211,6 @@ impl<'tcx> Visitor<'tcx> for TyPathVisitor<'tcx> {
239211 rl:: Region :: Static
240212 | rl:: Region :: EarlyBound ( _, _)
241213 | rl:: Region :: LateBound ( _, _, _)
242- | rl:: Region :: LateBoundAnon ( _, _, _)
243214 | rl:: Region :: Free ( _, _) ,
244215 )
245216 | None ,
0 commit comments