about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorFelix S. Klock II <pnkfelix@pnkfx.org>2015-02-12 13:53:16 +0100
committerFelix S. Klock II <pnkfelix@pnkfx.org>2015-02-12 13:55:49 +0100
commit6cc3b00d3f7b1e7512d85830bf62f2acc461237d (patch)
tree3750b0d195e5f7c30944c2f6339bef540ecb3c52 /src
parent32d0dbd49a372b9d2e000587497de6ffca9e1cca (diff)
downloadrust-6cc3b00d3f7b1e7512d85830bf62f2acc461237d.tar.gz
rust-6cc3b00d3f7b1e7512d85830bf62f2acc461237d.zip
Add a couple FIXME notes inspired during my review.
Diffstat (limited to 'src')
-rw-r--r--src/librustc_borrowck/borrowck/check_loans.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/librustc_borrowck/borrowck/check_loans.rs b/src/librustc_borrowck/borrowck/check_loans.rs
index d3f830c7e84..a18e8b16e8b 100644
--- a/src/librustc_borrowck/borrowck/check_loans.rs
+++ b/src/librustc_borrowck/borrowck/check_loans.rs
@@ -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(
@@ -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