Skip to content

Commit a651777

Browse files
committed
Auto merge of #57365 - sinkuu:unused, r=oli-obk
Remove unused code
2 parents 789a15a + 75ac204 commit a651777

File tree

1 file changed

+0
-30
lines changed

1 file changed

+0
-30
lines changed

src/librustc_mir/transform/generator.rs

-30
Original file line numberDiff line numberDiff line change
@@ -329,36 +329,6 @@ impl<'tcx> Visitor<'tcx> for StorageIgnored {
329329
}
330330
}
331331

332-
struct BorrowedLocals(liveness::LiveVarSet<Local>);
333-
334-
fn mark_as_borrowed<'tcx>(place: &Place<'tcx>, locals: &mut BorrowedLocals) {
335-
match *place {
336-
Place::Local(l) => { locals.0.insert(l); },
337-
Place::Promoted(_) |
338-
Place::Static(..) => (),
339-
Place::Projection(ref proj) => {
340-
match proj.elem {
341-
// For derefs we don't look any further.
342-
// If it pointed to a Local, it would already be borrowed elsewhere
343-
ProjectionElem::Deref => (),
344-
_ => mark_as_borrowed(&proj.base, locals)
345-
}
346-
}
347-
}
348-
}
349-
350-
impl<'tcx> Visitor<'tcx> for BorrowedLocals {
351-
fn visit_rvalue(&mut self,
352-
rvalue: &Rvalue<'tcx>,
353-
location: Location) {
354-
if let Rvalue::Ref(_, _, ref place) = *rvalue {
355-
mark_as_borrowed(place, self);
356-
}
357-
358-
self.super_rvalue(rvalue, location)
359-
}
360-
}
361-
362332
fn locals_live_across_suspend_points(
363333
tcx: TyCtxt<'a, 'tcx, 'tcx>,
364334
mir: &Mir<'tcx>,

0 commit comments

Comments
 (0)