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(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 Iterator for Peekable { #[inline] fn nth(&mut self, n: usize) -> Option { - // 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; }