Skip to content

Commit f2453e5

Browse files
committed
Remove MoveVisitor.
It's a trivial and unnecessary wrapper around `MirBorrowCtxt`.
1 parent fc7bb9b commit f2453e5

File tree

1 file changed

+3
-7
lines changed
  • compiler/rustc_borrowck/src

1 file changed

+3
-7
lines changed

compiler/rustc_borrowck/src/lib.rs

+3-7
Original file line numberDiff line numberDiff line change
@@ -300,18 +300,14 @@ fn do_mir_borrowck<'tcx>(
300300
move_errors: Vec::new(),
301301
diags,
302302
};
303-
MoveVisitor { ctxt: &mut promoted_mbcx }.visit_body(promoted_body);
303+
promoted_mbcx.visit_body(promoted_body);
304304
promoted_mbcx.report_move_errors();
305305
diags = promoted_mbcx.diags;
306306

307-
struct MoveVisitor<'a, 'mir, 'infcx, 'tcx> {
308-
ctxt: &'a mut MirBorrowckCtxt<'mir, 'infcx, 'tcx>,
309-
}
310-
311-
impl<'tcx> Visitor<'tcx> for MoveVisitor<'_, '_, '_, 'tcx> {
307+
impl<'tcx> Visitor<'tcx> for MirBorrowckCtxt<'_, '_, 'tcx> {
312308
fn visit_operand(&mut self, operand: &Operand<'tcx>, location: Location) {
313309
if let Operand::Move(place) = operand {
314-
self.ctxt.check_movable_place(location, *place);
310+
self.check_movable_place(location, *place);
315311
}
316312
}
317313
}

0 commit comments

Comments
 (0)