]> git.lizzy.rs Git - rust.git/commitdiff
typeck: remove remaining boxed closures
authorJorge Aparicio <japaricious@gmail.com>
Sun, 4 Jan 2015 22:22:50 +0000 (17:22 -0500)
committerJorge Aparicio <japaricious@gmail.com>
Mon, 5 Jan 2015 22:22:14 +0000 (17:22 -0500)
src/librustc_typeck/check/method/probe.rs
src/librustc_typeck/check/wf.rs

index 8adb592633f5edd7070252727e7d573d6f8aa594..beb51590b4159249338029abcf52a678e6149b2f 100644 (file)
@@ -387,14 +387,18 @@ fn assemble_inherent_candidates_from_param(&mut self,
 
     // Do a search through a list of bounds, using a callback to actually
     // create the candidates.
-    fn elaborate_bounds(
+    fn elaborate_bounds<F>(
         &mut self,
         bounds: &[ty::PolyTraitRef<'tcx>],
         num_includes_types: bool,
-        mk_cand: for<'b> |this: &mut ProbeContext<'b, 'tcx>,
-                          tr: ty::PolyTraitRef<'tcx>,
-                          m: Rc<ty::Method<'tcx>>,
-                          method_num: uint|)
+        mut mk_cand: F,
+    ) where
+        F: for<'b> FnMut(
+            &mut ProbeContext<'b, 'tcx>,
+            ty::PolyTraitRef<'tcx>,
+            Rc<ty::Method<'tcx>>,
+            uint,
+        ),
     {
         debug!("elaborate_bounds(bounds={})", bounds.repr(self.tcx()));
 
index 42ac1af325f4842f4194b0783027459e375bb11c..d4a5bda5f97f9e930f5c8f5055e45d08c9408070 100644 (file)
@@ -81,10 +81,9 @@ fn check_item_well_formed(&mut self, item: &ast::Item) {
         }
     }
 
-    fn with_fcx(&mut self,
-                item: &ast::Item,
-                f: for<'fcx> |&mut CheckTypeWellFormedVisitor<'ccx, 'tcx>,
-                              &FnCtxt<'fcx, 'tcx>|) {
+    fn with_fcx<F>(&mut self, item: &ast::Item, mut f: F) where
+        F: for<'fcx> FnMut(&mut CheckTypeWellFormedVisitor<'ccx, 'tcx>, &FnCtxt<'fcx, 'tcx>),
+    {
         let ccx = self.ccx;
         let item_def_id = local_def(item.id);
         let polytype = ty::lookup_item_type(ccx.tcx, item_def_id);
@@ -100,10 +99,8 @@ fn with_fcx(&mut self,
     }
 
     /// In a type definition, we check that to ensure that the types of the fields are well-formed.
-    fn check_type_defn(&mut self,
-                       item: &ast::Item,
-                       lookup_fields: for<'fcx> |&FnCtxt<'fcx, 'tcx>|
-                                                 -> Vec<AdtVariant<'tcx>>)
+    fn check_type_defn<F>(&mut self, item: &ast::Item, mut lookup_fields: F) where
+        F: for<'fcx> FnMut(&FnCtxt<'fcx, 'tcx>) -> Vec<AdtVariant<'tcx>>,
     {
         self.with_fcx(item, |this, fcx| {
             let variants = lookup_fields(fcx);