13
13
14
14
pub use self :: MoveKind :: * ;
15
15
16
+ use dataflow:: { DataFlowContext , BitwiseOperator , DataFlowOperator , KillFrom } ;
17
+
16
18
use borrowck:: * ;
17
19
use 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 ;
24
20
use rustc:: ty:: { self , TyCtxt } ;
25
- use rustc:: util:: nodemap:: { FxHashMap , FxHashSet } ;
21
+ use rustc:: util:: nodemap:: FxHashMap ;
26
22
27
23
use std:: cell:: RefCell ;
28
24
use std:: rc:: Rc ;
@@ -51,9 +47,6 @@ pub struct MoveData<'tcx> {
51
47
/// assigned dataflow bits, but we track them because they still
52
48
/// kill move bits.
53
49
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 > > ,
57
50
}
58
51
59
52
pub struct FlowedMoveData < ' a , ' tcx : ' a > {
@@ -151,9 +144,6 @@ pub struct Assignment {
151
144
152
145
/// span of node where assignment occurs
153
146
pub span : Span ,
154
-
155
- /// id for place expression on lhs of assignment
156
- pub assignee_id : hir:: ItemLocalId ,
157
147
}
158
148
159
149
#[ derive( Clone , Copy ) ]
@@ -388,9 +378,7 @@ impl<'a, 'tcx> MoveData<'tcx> {
388
378
pub fn add_assignment ( & self , tcx : TyCtxt < ' a , ' tcx , ' tcx > ,
389
379
lp : Rc < LoanPath < ' tcx > > ,
390
380
assign_id : hir:: ItemLocalId ,
391
- span : Span ,
392
- assignee_id : hir:: ItemLocalId ,
393
- mode : euv:: MutateMode ) {
381
+ span : Span ) {
394
382
// Assigning to one union field automatically assigns to all its fields.
395
383
if let LpExtend ( ref base_lp, mutbl, LpInterior ( opt_variant_id, interior) ) = lp. kind {
396
384
if let ty:: TyAdt ( adt_def, _) = base_lp. ty . sty {
@@ -407,39 +395,28 @@ impl<'a, 'tcx> MoveData<'tcx> {
407
395
LpInterior ( opt_variant_id, field) ) ;
408
396
let sibling_lp = Rc :: new ( LoanPath :: new ( sibling_lp_kind, field_ty) ) ;
409
397
self . add_assignment_helper ( tcx, sibling_lp, assign_id,
410
- span, assignee_id , mode ) ;
398
+ span) ;
411
399
}
412
400
return ;
413
401
}
414
402
}
415
403
}
416
404
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) ;
418
406
}
419
407
420
408
fn add_assignment_helper ( & self , tcx : TyCtxt < ' a , ' tcx , ' tcx > ,
421
409
lp : Rc < LoanPath < ' tcx > > ,
422
410
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) ;
428
413
429
414
let path_index = self . move_path ( tcx, lp. clone ( ) ) ;
430
415
431
- match mode {
432
- MutateMode :: Init | MutateMode :: JustWrite => {
433
- self . assignee_ids . borrow_mut ( ) . insert ( assignee_id) ;
434
- }
435
- MutateMode :: WriteAndRead => { }
436
- }
437
-
438
416
let assignment = Assignment {
439
417
path : path_index,
440
418
id : assign_id,
441
419
span,
442
- assignee_id,
443
420
} ;
444
421
445
422
if self . is_var_path ( path_index) {
0 commit comments