Skip to content

Commit 6cc3b00

Browse files
committed
Add a couple FIXME notes inspired during my review.
1 parent 32d0dbd commit 6cc3b00

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/librustc_borrowck/borrowck/check_loans.rs

+8
Original file line numberDiff line numberDiff line change
@@ -699,6 +699,11 @@ impl<'a, 'tcx> CheckLoanCtxt<'a, 'tcx> {
699699
lp: &Rc<LoanPath<'tcx>>) {
700700
debug!("check_if_path_is_moved(id={}, use_kind={:?}, lp={})",
701701
id, use_kind, lp.repr(self.bccx.tcx));
702+
703+
// FIXME (22079): if you find yourself tempted to cut and paste
704+
// the body below and then specializing the error reporting,
705+
// consider refactoring this instead!
706+
702707
let base_lp = owned_ptr_base_path_rc(lp);
703708
self.move_data.each_move_of(id, &base_lp, |the_move, moved_lp| {
704709
self.bccx.report_use_of_moved_value(
@@ -751,6 +756,9 @@ impl<'a, 'tcx> CheckLoanCtxt<'a, 'tcx> {
751756
// In the case where the owner implements drop, then
752757
// the path must be initialized to prevent a case of
753758
// partial reinitialization
759+
//
760+
// FIXME (22079): could refactor via hypothetical
761+
// generalized check_if_path_is_moved
754762
let loan_path = owned_ptr_base_path_rc(lp_base);
755763
self.move_data.each_move_of(id, &loan_path, |_, _| {
756764
self.bccx

0 commit comments

Comments
 (0)