Skip to content

Commit 66c032c

Browse files
committed
more comments
1 parent 37df5e0 commit 66c032c

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

src/libcore/cell.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1084,7 +1084,7 @@ impl<'b, T: ?Sized> RefMut<'b, T> {
10841084
pub fn map<U: ?Sized, F>(orig: RefMut<'b, T>, f: F) -> RefMut<'b, U>
10851085
where F: FnOnce(&mut T) -> &mut U
10861086
{
1087-
// FIXME: fix borrow-check
1087+
// FIXME(nll-rfc#40): fix borrow-check
10881088
let RefMut { value, borrow } = orig;
10891089
RefMut {
10901090
value: f(value),

src/libcore/iter/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1776,7 +1776,7 @@ impl<I: Iterator> Iterator for Peekable<I> {
17761776

17771777
#[inline]
17781778
fn nth(&mut self, n: usize) -> Option<I::Item> {
1779-
// FIXME: merge these when borrow-checking gets better.
1779+
// FIXME(#6393): merge these when borrow-checking gets better.
17801780
if n == 0 {
17811781
match self.peeked.take() {
17821782
Some(v) => v,

src/librustc_mir/borrow_check/mod.rs

+11-6
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,11 @@ pub struct MirBorrowckCtxt<'cx, 'gcx: 'tcx, 'tcx: 'cx> {
236236
move_data: &'cx MoveData<'tcx>,
237237
param_env: ParamEnv<'gcx>,
238238
/// This keeps track of whether local variables are free-ed when the function
239-
/// exits even without a `StorageDead`.
239+
/// exits even without a `StorageDead`, which appears to be the case for
240+
/// constants.
241+
///
242+
/// I'm not sure this is the right approach - @eddyb could you try and
243+
/// figure this out?
240244
locals_are_invalidated_at_exit: bool,
241245
/// This field keeps track of when storage dead or drop errors are reported
242246
/// in order to stop duplicate error reporting and identify the conditions required
@@ -973,7 +977,7 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
973977
// we just know that all locals are dropped at function exit (otherwise
974978
// we'll have a memory leak) and assume that all statics have a destructor.
975979
//
976-
// FIXME: allow thread-locals to borrow other thread locals?x
980+
// FIXME: allow thread-locals to borrow other thread locals?
977981
let (might_be_alive, will_be_dropped, local) = match root_place {
978982
Place::Static(statik) => {
979983
// Thread-locals might be dropped after the function exits, but
@@ -1523,9 +1527,10 @@ enum Overlap {
15231527
/// if `u` is a union, we have no way of telling how disjoint
15241528
/// `u.a.x` and `a.b.y` are.
15251529
Arbitrary,
1526-
/// The places are either completely disjoint or equal - this
1527-
/// is the "base case" on which we recur for extensions of
1528-
/// the place.
1530+
/// The places have the same type, and are either completely disjoint
1531+
/// or equal - i.e. they can't "partially" overlap as can occur with
1532+
/// unions. This is the "base case" on which we recur for extensions
1533+
/// of the place.
15291534
EqualOrDisjoint,
15301535
/// The places are disjoint, so we know all extensions of them
15311536
/// will also be disjoint.
@@ -1688,7 +1693,7 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
16881693
Place::Projection(interior) => {
16891694
place = &interior.base;
16901695
}
1691-
_ => {
1696+
Place::Local(_) | Place::Static(_) => {
16921697
result.reverse();
16931698
return result;
16941699
}

0 commit comments

Comments
 (0)