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