]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc/middle/ty_fold.rs
Merge pull request #20674 from jbcrail/fix-misspelled-comments
[rust.git] / src / librustc / middle / ty_fold.rs
index 1421987e3b52615866b7da721bbbcdb9fa65a297..424e357d8d456372112e264dc18909e85380ee74 100644 (file)
@@ -844,7 +844,7 @@ fn fold_region(&mut self, r: ty::Region) -> ty::Region {
             _ => {
                 debug!("RegionFolder.fold_region({}) folding free region (current_depth={})",
                        r.repr(self.tcx()), self.current_depth);
-                self.fld_r.call_mut((r, self.current_depth))
+                (self.fld_r)(r, self.current_depth)
             }
         }
     }
@@ -868,6 +868,9 @@ impl<'a, 'tcx> TypeFolder<'tcx> for RegionEraser<'a, 'tcx> {
     fn tcx(&self) -> &ty::ctxt<'tcx> { self.tcx }
 
     fn fold_region(&mut self, r: ty::Region) -> ty::Region {
+        // because whether or not a region is bound affects subtyping,
+        // we can't erase the bound/free distinction, but we can
+        // replace all free regions with 'static
         match r {
             ty::ReLateBound(..) | ty::ReEarlyBound(..) => r,
             _ => ty::ReStatic