]> git.lizzy.rs Git - rust.git/commitdiff
Remove arms_have_move_bindings
authorSeo Sanghyeon <sanxiyn@gmail.com>
Mon, 25 Nov 2013 14:36:20 +0000 (23:36 +0900)
committerSeo Sanghyeon <sanxiyn@gmail.com>
Mon, 25 Nov 2013 14:36:20 +0000 (23:36 +0900)
src/librustc/middle/moves.rs

index 8493a7e00ddbeb916ea5528004cc528458f86a20..9e84b32ae8ffb591c0e342f9c7fddd7690738a04 100644 (file)
@@ -459,8 +459,6 @@ fn has_dtor(tcx: ty::ctxt, ty: ty::t) -> bool {
             }
 
             ExprMatch(discr, ref arms) => {
-                // We must do this first so that `arms_have_by_move_bindings`
-                // below knows which bindings are moves.
                 for arm in arms.iter() {
                     self.consume_arm(arm);
                 }
@@ -657,27 +655,6 @@ pub fn use_fn_arg(&mut self, arg_expr: @Expr) {
         self.consume_expr(arg_expr)
     }
 
-    pub fn arms_have_by_move_bindings(&mut self,
-                                      moves_map: MovesMap,
-                                      arms: &[Arm])
-                                      -> Option<@Pat> {
-        let mut ret = None;
-        for arm in arms.iter() {
-            for &pat in arm.pats.iter() {
-                let cont = do ast_util::walk_pat(pat) |p| {
-                    if moves_map.contains(&p.id) {
-                        ret = Some(p);
-                        false
-                    } else {
-                        true
-                    }
-                };
-                if !cont { return ret }
-            }
-        }
-        ret
-    }
-
     pub fn compute_captures(&mut self, fn_expr_id: NodeId) -> @[CaptureVar] {
         debug!("compute_capture_vars(fn_expr_id={:?})", fn_expr_id);
         let _indenter = indenter();