]> git.lizzy.rs Git - rust.git/commitdiff
fix debruijn account in `for_each_free_region`
authorNiko Matsakis <niko@alum.mit.edu>
Wed, 22 Nov 2017 21:52:29 +0000 (16:52 -0500)
committerNiko Matsakis <niko@alum.mit.edu>
Mon, 4 Dec 2017 14:14:38 +0000 (09:14 -0500)
src/librustc/ty/fold.rs

index fbbc0e92bcdba2d17c094f7fe94361db9865d219..069dc0275cbb17f8e70fd94870c8033615c43962 100644 (file)
@@ -247,7 +247,7 @@ fn visit_binder<T: TypeFoldable<'tcx>>(&mut self, t: &Binder<T>) -> bool {
 
             fn visit_region(&mut self, r: ty::Region<'tcx>) -> bool {
                 match *r {
-                    ty::ReLateBound(debruijn, _) if debruijn.depth < self.current_depth => {
+                    ty::ReLateBound(debruijn, _) if debruijn.depth <= self.current_depth => {
                         /* ignore bound regions */
                     }
                     _ => (self.callback)(r),