@@ -236,7 +236,11 @@ pub struct MirBorrowckCtxt<'cx, 'gcx: 'tcx, 'tcx: 'cx> {
236
236
move_data : & ' cx MoveData < ' tcx > ,
237
237
param_env : ParamEnv < ' gcx > ,
238
238
/// 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?
240
244
locals_are_invalidated_at_exit : bool ,
241
245
/// This field keeps track of when storage dead or drop errors are reported
242
246
/// in order to stop duplicate error reporting and identify the conditions required
@@ -973,7 +977,7 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
973
977
// we just know that all locals are dropped at function exit (otherwise
974
978
// we'll have a memory leak) and assume that all statics have a destructor.
975
979
//
976
- // FIXME: allow thread-locals to borrow other thread locals?x
980
+ // FIXME: allow thread-locals to borrow other thread locals?
977
981
let ( might_be_alive, will_be_dropped, local) = match root_place {
978
982
Place :: Static ( statik) => {
979
983
// Thread-locals might be dropped after the function exits, but
@@ -1523,9 +1527,10 @@ enum Overlap {
1523
1527
/// if `u` is a union, we have no way of telling how disjoint
1524
1528
/// `u.a.x` and `a.b.y` are.
1525
1529
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.
1529
1534
EqualOrDisjoint ,
1530
1535
/// The places are disjoint, so we know all extensions of them
1531
1536
/// will also be disjoint.
@@ -1688,7 +1693,7 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
1688
1693
Place :: Projection ( interior) => {
1689
1694
place = & interior. base ;
1690
1695
}
1691
- _ => {
1696
+ Place :: Local ( _ ) | Place :: Static ( _ ) => {
1692
1697
result. reverse ( ) ;
1693
1698
return result;
1694
1699
}
0 commit comments