@@ -1602,10 +1602,6 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
16021602 place_span : ( & Place < ' tcx > , Span ) ,
16031603 flow_state : & Flows < ' cx , ' gcx , ' tcx > ,
16041604 ) {
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-
16091605 let maybe_uninits = & flow_state. uninits ;
16101606
16111607 // Bad scenarios:
@@ -1643,8 +1639,8 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
16431639 //
16441640 // This code covers scenarios 1, 2, and 3.
16451641
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 ) {
16481644 Ok ( mpi) => {
16491645 if maybe_uninits. contains ( & mpi) {
16501646 self . report_use_of_moved_or_uninitialized (
@@ -1674,10 +1670,6 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
16741670 place_span : ( & Place < ' tcx > , Span ) ,
16751671 flow_state : & Flows < ' cx , ' gcx , ' tcx > ,
16761672 ) {
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-
16811673 let maybe_uninits = & flow_state. uninits ;
16821674
16831675 // Bad scenarios:
@@ -1706,8 +1698,8 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
17061698 //
17071699 // This code covers scenario 1.
17081700
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 ) {
17111703 if let Some ( child_mpi) = maybe_uninits. has_any_child_of ( mpi) {
17121704 self . report_use_of_moved_or_uninitialized (
17131705 context,
@@ -1810,11 +1802,6 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
18101802 let tcx = self . tcx ;
18111803 match base. ty ( self . mir , tcx) . to_ty ( tcx) . sty {
18121804 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-
18181805 self . check_if_path_or_subpath_is_moved (
18191806 context, InitializationRequiringAction :: Assignment ,
18201807 ( base, span) , flow_state) ;
@@ -2187,35 +2174,6 @@ enum Overlap {
21872174 Disjoint ,
21882175}
21892176
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-
22192177#[ derive( Copy , Clone , PartialEq , Eq , Debug ) ]
22202178struct Context {
22212179 kind : ContextKind ,
0 commit comments