about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorShotaro Yamada <sinkuu@sinkuu.xyz>2019-01-06 10:08:11 +0900
committerShotaro Yamada <sinkuu@sinkuu.xyz>2019-01-06 10:08:11 +0900
commit75ac204f3f6883f17529e409440fb261a1a3d766 (patch)
tree11c68b115d94cf324dbe33e38c69bfcf4f080047 /src
parent68fe5182c967259ef89dbe313e4bf80f45a53e7e (diff)
downloadrust-75ac204f3f6883f17529e409440fb261a1a3d766.tar.gz
rust-75ac204f3f6883f17529e409440fb261a1a3d766.zip
Remove unused code
Diffstat (limited to 'src')
-rw-r--r--src/librustc_mir/transform/generator.rs30
1 files changed, 0 insertions, 30 deletions
diff --git a/src/librustc_mir/transform/generator.rs b/src/librustc_mir/transform/generator.rs
index 808c3aad292..ec0c118634d 100644
--- a/src/librustc_mir/transform/generator.rs
+++ b/src/librustc_mir/transform/generator.rs
@@ -329,36 +329,6 @@ impl<'tcx> Visitor<'tcx> for StorageIgnored {
     }
 }
 
-struct BorrowedLocals(liveness::LiveVarSet<Local>);
-
-fn mark_as_borrowed<'tcx>(place: &Place<'tcx>, locals: &mut BorrowedLocals) {
-    match *place {
-        Place::Local(l) => { locals.0.insert(l); },
-        Place::Promoted(_) |
-        Place::Static(..) => (),
-        Place::Projection(ref proj) => {
-            match proj.elem {
-                // For derefs we don't look any further.
-                // If it pointed to a Local, it would already be borrowed elsewhere
-                ProjectionElem::Deref => (),
-                _ => mark_as_borrowed(&proj.base, locals)
-            }
-        }
-    }
-}
-
-impl<'tcx> Visitor<'tcx> for BorrowedLocals {
-    fn visit_rvalue(&mut self,
-                    rvalue: &Rvalue<'tcx>,
-                    location: Location) {
-        if let Rvalue::Ref(_, _, ref place) = *rvalue {
-            mark_as_borrowed(place, self);
-        }
-
-        self.super_rvalue(rvalue, location)
-    }
-}
-
 fn locals_live_across_suspend_points(
     tcx: TyCtxt<'a, 'tcx, 'tcx>,
     mir: &Mir<'tcx>,