1313
1414pub use self :: MoveKind :: * ;
1515
16+ use dataflow:: { DataFlowContext , BitwiseOperator , DataFlowOperator , KillFrom } ;
17+
1618use borrowck:: * ;
1719use rustc:: cfg;
18- use rustc:: middle:: dataflow:: DataFlowContext ;
19- use rustc:: middle:: dataflow:: BitwiseOperator ;
20- use rustc:: middle:: dataflow:: DataFlowOperator ;
21- use rustc:: middle:: dataflow:: KillFrom ;
22- use rustc:: middle:: expr_use_visitor as euv;
23- use rustc:: middle:: expr_use_visitor:: MutateMode ;
2420use rustc:: ty:: { self , TyCtxt } ;
25- use rustc:: util:: nodemap:: { FxHashMap , FxHashSet } ;
21+ use rustc:: util:: nodemap:: FxHashMap ;
2622
2723use std:: cell:: RefCell ;
2824use std:: rc:: Rc ;
@@ -51,9 +47,6 @@ pub struct MoveData<'tcx> {
5147 /// assigned dataflow bits, but we track them because they still
5248 /// kill move bits.
5349 pub path_assignments : RefCell < Vec < Assignment > > ,
54-
55- /// Assignments to a variable or path, like `x = foo`, but not `x += foo`.
56- pub assignee_ids : RefCell < FxHashSet < hir:: ItemLocalId > > ,
5750}
5851
5952pub struct FlowedMoveData < ' a , ' tcx : ' a > {
@@ -151,9 +144,6 @@ pub struct Assignment {
151144
152145 /// span of node where assignment occurs
153146 pub span : Span ,
154-
155- /// id for place expression on lhs of assignment
156- pub assignee_id : hir:: ItemLocalId ,
157147}
158148
159149#[ derive( Clone , Copy ) ]
@@ -388,9 +378,7 @@ impl<'a, 'tcx> MoveData<'tcx> {
388378 pub fn add_assignment ( & self , tcx : TyCtxt < ' a , ' tcx , ' tcx > ,
389379 lp : Rc < LoanPath < ' tcx > > ,
390380 assign_id : hir:: ItemLocalId ,
391- span : Span ,
392- assignee_id : hir:: ItemLocalId ,
393- mode : euv:: MutateMode ) {
381+ span : Span ) {
394382 // Assigning to one union field automatically assigns to all its fields.
395383 if let LpExtend ( ref base_lp, mutbl, LpInterior ( opt_variant_id, interior) ) = lp. kind {
396384 if let ty:: TyAdt ( adt_def, _) = base_lp. ty . sty {
@@ -407,39 +395,28 @@ impl<'a, 'tcx> MoveData<'tcx> {
407395 LpInterior ( opt_variant_id, field) ) ;
408396 let sibling_lp = Rc :: new ( LoanPath :: new ( sibling_lp_kind, field_ty) ) ;
409397 self . add_assignment_helper ( tcx, sibling_lp, assign_id,
410- span, assignee_id , mode ) ;
398+ span) ;
411399 }
412400 return ;
413401 }
414402 }
415403 }
416404
417- self . add_assignment_helper ( tcx, lp. clone ( ) , assign_id, span, assignee_id , mode ) ;
405+ self . add_assignment_helper ( tcx, lp. clone ( ) , assign_id, span) ;
418406 }
419407
420408 fn add_assignment_helper ( & self , tcx : TyCtxt < ' a , ' tcx , ' tcx > ,
421409 lp : Rc < LoanPath < ' tcx > > ,
422410 assign_id : hir:: ItemLocalId ,
423- span : Span ,
424- assignee_id : hir:: ItemLocalId ,
425- mode : euv:: MutateMode ) {
426- debug ! ( "add_assignment(lp={:?}, assign_id={:?}, assignee_id={:?}" ,
427- lp, assign_id, assignee_id) ;
411+ span : Span ) {
412+ debug ! ( "add_assignment(lp={:?}, assign_id={:?}" , lp, assign_id) ;
428413
429414 let path_index = self . move_path ( tcx, lp. clone ( ) ) ;
430415
431- match mode {
432- MutateMode :: Init | MutateMode :: JustWrite => {
433- self . assignee_ids . borrow_mut ( ) . insert ( assignee_id) ;
434- }
435- MutateMode :: WriteAndRead => { }
436- }
437-
438416 let assignment = Assignment {
439417 path : path_index,
440418 id : assign_id,
441419 span,
442- assignee_id,
443420 } ;
444421
445422 if self . is_var_path ( path_index) {
0 commit comments