@@ -54,7 +54,6 @@ use rustc_mir_dataflow::MoveDataParamEnv;
5454use self :: diagnostics:: { AccessKind , RegionName } ;
5555use self :: location:: LocationTable ;
5656use self :: prefixes:: PrefixSet ;
57- use self :: MutateMode :: JustWrite ;
5857use facts:: AllFacts ;
5958
6059use self :: path_utils:: * ;
@@ -629,7 +628,7 @@ impl<'cx, 'tcx> rustc_mir_dataflow::ResultsVisitor<'cx, 'tcx> for MirBorrowckCtx
629628 StatementKind :: Assign ( box ( lhs, ref rhs) ) => {
630629 self . consume_rvalue ( location, ( rhs, span) , flow_state) ;
631630
632- self . mutate_place ( location, ( * lhs, span) , Shallow ( None ) , JustWrite , flow_state) ;
631+ self . mutate_place ( location, ( * lhs, span) , Shallow ( None ) , flow_state) ;
633632 }
634633 StatementKind :: FakeRead ( box ( _, ref place) ) => {
635634 // Read for match doesn't access any memory and is used to
@@ -650,7 +649,7 @@ impl<'cx, 'tcx> rustc_mir_dataflow::ResultsVisitor<'cx, 'tcx> for MirBorrowckCtx
650649 ) ;
651650 }
652651 StatementKind :: SetDiscriminant { place, variant_index : _ } => {
653- self . mutate_place ( location, ( * * place, span) , Shallow ( None ) , JustWrite , flow_state) ;
652+ self . mutate_place ( location, ( * * place, span) , Shallow ( None ) , flow_state) ;
654653 }
655654 StatementKind :: CopyNonOverlapping ( box rustc_middle:: mir:: CopyNonOverlapping {
656655 ..
@@ -716,7 +715,7 @@ impl<'cx, 'tcx> rustc_mir_dataflow::ResultsVisitor<'cx, 'tcx> for MirBorrowckCtx
716715 target : _,
717716 unwind : _,
718717 } => {
719- self . mutate_place ( loc, ( drop_place, span) , Deep , JustWrite , flow_state) ;
718+ self . mutate_place ( loc, ( drop_place, span) , Deep , flow_state) ;
720719 self . consume_operand ( loc, ( new_value, span) , flow_state) ;
721720 }
722721 TerminatorKind :: Call {
@@ -732,7 +731,7 @@ impl<'cx, 'tcx> rustc_mir_dataflow::ResultsVisitor<'cx, 'tcx> for MirBorrowckCtx
732731 self . consume_operand ( loc, ( arg, span) , flow_state) ;
733732 }
734733 if let Some ( ( dest, _ /*bb*/ ) ) = * destination {
735- self . mutate_place ( loc, ( dest, span) , Deep , JustWrite , flow_state) ;
734+ self . mutate_place ( loc, ( dest, span) , Deep , flow_state) ;
736735 }
737736 }
738737 TerminatorKind :: Assert { ref cond, expected : _, ref msg, target : _, cleanup : _ } => {
@@ -746,7 +745,7 @@ impl<'cx, 'tcx> rustc_mir_dataflow::ResultsVisitor<'cx, 'tcx> for MirBorrowckCtx
746745
747746 TerminatorKind :: Yield { ref value, resume : _, resume_arg, drop : _ } => {
748747 self . consume_operand ( loc, ( value, span) , flow_state) ;
749- self . mutate_place ( loc, ( resume_arg, span) , Deep , JustWrite , flow_state) ;
748+ self . mutate_place ( loc, ( resume_arg, span) , Deep , flow_state) ;
750749 }
751750
752751 TerminatorKind :: InlineAsm {
@@ -764,13 +763,7 @@ impl<'cx, 'tcx> rustc_mir_dataflow::ResultsVisitor<'cx, 'tcx> for MirBorrowckCtx
764763 }
765764 InlineAsmOperand :: Out { reg : _, late : _, place, .. } => {
766765 if let Some ( place) = place {
767- self . mutate_place (
768- loc,
769- ( place, span) ,
770- Shallow ( None ) ,
771- JustWrite ,
772- flow_state,
773- ) ;
766+ self . mutate_place ( loc, ( place, span) , Shallow ( None ) , flow_state) ;
774767 }
775768 }
776769 InlineAsmOperand :: InOut { reg : _, late : _, ref in_value, out_place } => {
@@ -780,7 +773,6 @@ impl<'cx, 'tcx> rustc_mir_dataflow::ResultsVisitor<'cx, 'tcx> for MirBorrowckCtx
780773 loc,
781774 ( out_place, span) ,
782775 Shallow ( None ) ,
783- JustWrite ,
784776 flow_state,
785777 ) ;
786778 }
@@ -852,12 +844,6 @@ impl<'cx, 'tcx> rustc_mir_dataflow::ResultsVisitor<'cx, 'tcx> for MirBorrowckCtx
852844 }
853845}
854846
855- #[ derive( Copy , Clone , PartialEq , Eq , Debug ) ]
856- enum MutateMode {
857- JustWrite ,
858- WriteAndRead ,
859- }
860-
861847use self :: AccessDepth :: { Deep , Shallow } ;
862848use self :: ReadOrWrite :: { Activation , Read , Reservation , Write } ;
863849
@@ -943,7 +929,6 @@ enum LocalMutationIsAllowed {
943929
944930#[ derive( Copy , Clone , Debug ) ]
945931enum InitializationRequiringAction {
946- Update ,
947932 Borrow ,
948933 MatchOn ,
949934 Use ,
@@ -960,7 +945,6 @@ struct RootPlace<'tcx> {
960945impl InitializationRequiringAction {
961946 fn as_noun ( self ) -> & ' static str {
962947 match self {
963- InitializationRequiringAction :: Update => "update" ,
964948 InitializationRequiringAction :: Borrow => "borrow" ,
965949 InitializationRequiringAction :: MatchOn => "use" , // no good noun
966950 InitializationRequiringAction :: Use => "use" ,
@@ -971,7 +955,6 @@ impl InitializationRequiringAction {
971955
972956 fn as_verb_in_past_tense ( self ) -> & ' static str {
973957 match self {
974- InitializationRequiringAction :: Update => "updated" ,
975958 InitializationRequiringAction :: Borrow => "borrowed" ,
976959 InitializationRequiringAction :: MatchOn => "matched on" ,
977960 InitializationRequiringAction :: Use => "used" ,
@@ -1208,23 +1191,10 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
12081191 location : Location ,
12091192 place_span : ( Place < ' tcx > , Span ) ,
12101193 kind : AccessDepth ,
1211- mode : MutateMode ,
12121194 flow_state : & Flows < ' cx , ' tcx > ,
12131195 ) {
1214- // Write of P[i] or *P, or WriteAndRead of any P, requires P init'd.
1215- match mode {
1216- MutateMode :: WriteAndRead => {
1217- self . check_if_path_or_subpath_is_moved (
1218- location,
1219- InitializationRequiringAction :: Update ,
1220- ( place_span. 0 . as_ref ( ) , place_span. 1 ) ,
1221- flow_state,
1222- ) ;
1223- }
1224- MutateMode :: JustWrite => {
1225- self . check_if_assigned_path_is_moved ( location, place_span, flow_state) ;
1226- }
1227- }
1196+ // Write of P[i] or *P requires P init'd.
1197+ self . check_if_assigned_path_is_moved ( location, place_span, flow_state) ;
12281198
12291199 // Special case: you can assign an immutable local variable
12301200 // (e.g., `x = ...`) so long as it has never been initialized
0 commit comments