@@ -1605,10 +1605,6 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
1605
1605
place_span : ( & Place < ' tcx > , Span ) ,
1606
1606
flow_state : & Flows < ' cx , ' gcx , ' tcx > ,
1607
1607
) {
1608
- // FIXME: analogous code in check_loans first maps `place` to
1609
- // its base_path ... but is that what we want here?
1610
- let place = self . base_path ( place_span. 0 ) ;
1611
-
1612
1608
let maybe_uninits = & flow_state. uninits ;
1613
1609
1614
1610
// Bad scenarios:
@@ -1646,8 +1642,8 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
1646
1642
//
1647
1643
// This code covers scenarios 1, 2, and 3.
1648
1644
1649
- debug ! ( "check_if_full_path_is_moved place: {:?}" , place ) ;
1650
- match self . move_path_closest_to ( place ) {
1645
+ debug ! ( "check_if_full_path_is_moved place: {:?}" , place_span . 0 ) ;
1646
+ match self . move_path_closest_to ( place_span . 0 ) {
1651
1647
Ok ( mpi) => {
1652
1648
if maybe_uninits. contains ( & mpi) {
1653
1649
self . report_use_of_moved_or_uninitialized (
@@ -1677,10 +1673,6 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
1677
1673
place_span : ( & Place < ' tcx > , Span ) ,
1678
1674
flow_state : & Flows < ' cx , ' gcx , ' tcx > ,
1679
1675
) {
1680
- // FIXME: analogous code in check_loans first maps `place` to
1681
- // its base_path ... but is that what we want here?
1682
- let place = self . base_path ( place_span. 0 ) ;
1683
-
1684
1676
let maybe_uninits = & flow_state. uninits ;
1685
1677
1686
1678
// Bad scenarios:
@@ -1709,8 +1701,8 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
1709
1701
//
1710
1702
// This code covers scenario 1.
1711
1703
1712
- debug ! ( "check_if_path_or_subpath_is_moved place: {:?}" , place ) ;
1713
- if let Some ( mpi) = self . move_path_for_place ( place ) {
1704
+ debug ! ( "check_if_path_or_subpath_is_moved place: {:?}" , place_span . 0 ) ;
1705
+ if let Some ( mpi) = self . move_path_for_place ( place_span . 0 ) {
1714
1706
if let Some ( child_mpi) = maybe_uninits. has_any_child_of ( mpi) {
1715
1707
self . report_use_of_moved_or_uninitialized (
1716
1708
context,
@@ -1813,11 +1805,6 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
1813
1805
let tcx = self . tcx ;
1814
1806
match base. ty ( self . mir , tcx) . to_ty ( tcx) . sty {
1815
1807
ty:: Adt ( def, _) if def. has_dtor ( tcx) => {
1816
-
1817
- // FIXME: analogous code in
1818
- // check_loans.rs first maps
1819
- // `base` to its base_path.
1820
-
1821
1808
self . check_if_path_or_subpath_is_moved (
1822
1809
context, InitializationRequiringAction :: Assignment ,
1823
1810
( base, span) , flow_state) ;
@@ -2190,35 +2177,6 @@ enum Overlap {
2190
2177
Disjoint ,
2191
2178
}
2192
2179
2193
- impl < ' cx , ' gcx , ' tcx > MirBorrowckCtxt < ' cx , ' gcx , ' tcx > {
2194
- // FIXME (#16118): function intended to allow the borrow checker
2195
- // to be less precise in its handling of Box while still allowing
2196
- // moves out of a Box. They should be removed when/if we stop
2197
- // treating Box specially (e.g. when/if DerefMove is added...)
2198
-
2199
- fn base_path < ' d > ( & self , place : & ' d Place < ' tcx > ) -> & ' d Place < ' tcx > {
2200
- //! Returns the base of the leftmost (deepest) dereference of an
2201
- //! Box in `place`. If there is no dereference of an Box
2202
- //! in `place`, then it just returns `place` itself.
2203
-
2204
- let mut cursor = place;
2205
- let mut deepest = place;
2206
- loop {
2207
- let proj = match * cursor {
2208
- Place :: Promoted ( _) |
2209
- Place :: Local ( ..) | Place :: Static ( ..) => return deepest,
2210
- Place :: Projection ( ref proj) => proj,
2211
- } ;
2212
- if proj. elem == ProjectionElem :: Deref
2213
- && place. ty ( self . mir , self . tcx ) . to_ty ( self . tcx ) . is_box ( )
2214
- {
2215
- deepest = & proj. base ;
2216
- }
2217
- cursor = & proj. base ;
2218
- }
2219
- }
2220
- }
2221
-
2222
2180
#[ derive( Copy , Clone , PartialEq , Eq , Debug ) ]
2223
2181
struct Context {
2224
2182
kind : ContextKind ,
0 commit comments