Skip to content

Commit

Permalink
Remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
sinkuu committed Jan 6, 2019
1 parent 68fe518 commit 75ac204
Showing 1 changed file with 0 additions and 30 deletions.
30 changes: 0 additions & 30 deletions src/librustc_mir/transform/generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>,
Expand Down

0 comments on commit 75ac204

Please sign in to comment.