Skip to content

Commit

Permalink
Add a couple FIXME notes inspired during my review.
Browse files Browse the repository at this point in the history
  • Loading branch information
pnkfelix committed Feb 12, 2015
1 parent 32d0dbd commit 6cc3b00
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/librustc_borrowck/borrowck/check_loans.rs
Original file line number Diff line number Diff line change
Expand Up @@ -699,6 +699,11 @@ impl<'a, 'tcx> CheckLoanCtxt<'a, 'tcx> {
lp: &Rc<LoanPath<'tcx>>) {
debug!("check_if_path_is_moved(id={}, use_kind={:?}, lp={})",
id, use_kind, lp.repr(self.bccx.tcx));

// FIXME (22079): if you find yourself tempted to cut and paste
// the body below and then specializing the error reporting,
// consider refactoring this instead!

let base_lp = owned_ptr_base_path_rc(lp);
self.move_data.each_move_of(id, &base_lp, |the_move, moved_lp| {
self.bccx.report_use_of_moved_value(
Expand Down Expand Up @@ -751,6 +756,9 @@ impl<'a, 'tcx> CheckLoanCtxt<'a, 'tcx> {
// In the case where the owner implements drop, then
// the path must be initialized to prevent a case of
// partial reinitialization
//
// FIXME (22079): could refactor via hypothetical
// generalized check_if_path_is_moved
let loan_path = owned_ptr_base_path_rc(lp_base);
self.move_data.each_move_of(id, &loan_path, |_, _| {
self.bccx
Expand Down

0 comments on commit 6cc3b00

Please sign in to comment.