about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAriel Ben-Yehuda <ariel.byd@gmail.com>2017-12-06 00:51:47 +0200
committerAriel Ben-Yehuda <ariel.byd@gmail.com>2017-12-06 00:51:47 +0200
commit66c032cb2d5748e36c416e25c75b80f137f3a7fc (patch)
tree8ae96ea75ab8c8cb54cc9454f4fd161b1eff3282
parent37df5e0b917a9c66f586a40e899fca8727efaac5 (diff)
downloadrust-66c032cb2d5748e36c416e25c75b80f137f3a7fc.tar.gz
rust-66c032cb2d5748e36c416e25c75b80f137f3a7fc.zip
more comments
-rw-r--r--src/libcore/cell.rs2
-rw-r--r--src/libcore/iter/mod.rs2
-rw-r--r--src/librustc_mir/borrow_check/mod.rs17
3 files changed, 13 insertions, 8 deletions
diff --git a/src/libcore/cell.rs b/src/libcore/cell.rs
index 4a66506fec7..93cfc845b1f 100644
--- a/src/libcore/cell.rs
+++ b/src/libcore/cell.rs
@@ -1084,7 +1084,7 @@ impl<'b, T: ?Sized> RefMut<'b, T> {
     pub fn map<U: ?Sized, F>(orig: RefMut<'b, T>, f: F) -> RefMut<'b, U>
         where F: FnOnce(&mut T) -> &mut U
     {
-        // FIXME: fix borrow-check
+        // FIXME(nll-rfc#40): fix borrow-check
         let RefMut { value, borrow } = orig;
         RefMut {
             value: f(value),
diff --git a/src/libcore/iter/mod.rs b/src/libcore/iter/mod.rs
index 1f7651b75cc..06c29b47bf9 100644
--- a/src/libcore/iter/mod.rs
+++ b/src/libcore/iter/mod.rs
@@ -1776,7 +1776,7 @@ impl<I: Iterator> Iterator for Peekable<I> {
 
     #[inline]
     fn nth(&mut self, n: usize) -> Option<I::Item> {
-        // FIXME: merge these when borrow-checking gets better.
+        // FIXME(#6393): merge these when borrow-checking gets better.
         if n == 0 {
             match self.peeked.take() {
                 Some(v) => v,
diff --git a/src/librustc_mir/borrow_check/mod.rs b/src/librustc_mir/borrow_check/mod.rs
index 0f4585c8c04..8d3491bd1d9 100644
--- a/src/librustc_mir/borrow_check/mod.rs
+++ b/src/librustc_mir/borrow_check/mod.rs
@@ -236,7 +236,11 @@ pub struct MirBorrowckCtxt<'cx, 'gcx: 'tcx, 'tcx: 'cx> {
     move_data: &'cx MoveData<'tcx>,
     param_env: ParamEnv<'gcx>,
     /// This keeps track of whether local variables are free-ed when the function
-    /// exits even without a `StorageDead`.
+    /// exits even without a `StorageDead`, which appears to be the case for
+    /// constants.
+    ///
+    /// I'm not sure this is the right approach - @eddyb could you try and
+    /// figure this out?
     locals_are_invalidated_at_exit: bool,
     /// This field keeps track of when storage dead or drop errors are reported
     /// in order to stop duplicate error reporting and identify the conditions required
@@ -973,7 +977,7 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
         // we just know that all locals are dropped at function exit (otherwise
         // we'll have a memory leak) and assume that all statics have a destructor.
         //
-        // FIXME: allow thread-locals to borrow other thread locals?x
+        // FIXME: allow thread-locals to borrow other thread locals?
         let (might_be_alive, will_be_dropped, local) = match root_place {
             Place::Static(statik) => {
                 // Thread-locals might be dropped after the function exits, but
@@ -1523,9 +1527,10 @@ enum Overlap {
     /// if `u` is a union, we have no way of telling how disjoint
     /// `u.a.x` and `a.b.y` are.
     Arbitrary,
-    /// The places are either completely disjoint or equal - this
-    /// is the "base case" on which we recur for extensions of
-    /// the place.
+    /// The places have the same type, and are either completely disjoint
+    /// or equal - i.e. they can't "partially" overlap as can occur with
+    /// unions. This is the "base case" on which we recur for extensions
+    /// of the place.
     EqualOrDisjoint,
     /// The places are disjoint, so we know all extensions of them
     /// will also be disjoint.
@@ -1688,7 +1693,7 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
                     Place::Projection(interior) => {
                         place = &interior.base;
                     }
-                    _ => {
+                    Place::Local(_) | Place::Static(_) => {
                         result.reverse();
                         return result;
                     }