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