@@ -287,24 +287,22 @@ impl<'a, 'tcx> BitDenotation for MaybeInitializedLvals<'a, 'tcx> {
287
287
288
288
fn statement_effect ( & self ,
289
289
sets : & mut BlockSets < MovePathIndex > ,
290
- bb : mir:: BasicBlock ,
291
- idx : usize )
290
+ location : Location )
292
291
{
293
292
drop_flag_effects_for_location (
294
293
self . tcx , self . mir , self . mdpe ,
295
- Location { block : bb , statement_index : idx } ,
294
+ location ,
296
295
|path, s| Self :: update_bits ( sets, path, s)
297
296
)
298
297
}
299
298
300
299
fn terminator_effect ( & self ,
301
300
sets : & mut BlockSets < MovePathIndex > ,
302
- bb : mir:: BasicBlock ,
303
- statements_len : usize )
301
+ location : Location )
304
302
{
305
303
drop_flag_effects_for_location (
306
304
self . tcx , self . mir , self . mdpe ,
307
- Location { block : bb , statement_index : statements_len } ,
305
+ location ,
308
306
|path, s| Self :: update_bits ( sets, path, s)
309
307
)
310
308
}
@@ -344,24 +342,22 @@ impl<'a, 'tcx> BitDenotation for MaybeUninitializedLvals<'a, 'tcx> {
344
342
345
343
fn statement_effect ( & self ,
346
344
sets : & mut BlockSets < MovePathIndex > ,
347
- bb : mir:: BasicBlock ,
348
- idx : usize )
345
+ location : Location )
349
346
{
350
347
drop_flag_effects_for_location (
351
348
self . tcx , self . mir , self . mdpe ,
352
- Location { block : bb , statement_index : idx } ,
349
+ location ,
353
350
|path, s| Self :: update_bits ( sets, path, s)
354
351
)
355
352
}
356
353
357
354
fn terminator_effect ( & self ,
358
355
sets : & mut BlockSets < MovePathIndex > ,
359
- bb : mir:: BasicBlock ,
360
- statements_len : usize )
356
+ location : Location )
361
357
{
362
358
drop_flag_effects_for_location (
363
359
self . tcx , self . mir , self . mdpe ,
364
- Location { block : bb , statement_index : statements_len } ,
360
+ location ,
365
361
|path, s| Self :: update_bits ( sets, path, s)
366
362
)
367
363
}
@@ -400,24 +396,22 @@ impl<'a, 'tcx> BitDenotation for DefinitelyInitializedLvals<'a, 'tcx> {
400
396
401
397
fn statement_effect ( & self ,
402
398
sets : & mut BlockSets < MovePathIndex > ,
403
- bb : mir:: BasicBlock ,
404
- idx : usize )
399
+ location : Location )
405
400
{
406
401
drop_flag_effects_for_location (
407
402
self . tcx , self . mir , self . mdpe ,
408
- Location { block : bb , statement_index : idx } ,
403
+ location ,
409
404
|path, s| Self :: update_bits ( sets, path, s)
410
405
)
411
406
}
412
407
413
408
fn terminator_effect ( & self ,
414
409
sets : & mut BlockSets < MovePathIndex > ,
415
- bb : mir:: BasicBlock ,
416
- statements_len : usize )
410
+ location : Location )
417
411
{
418
412
drop_flag_effects_for_location (
419
413
self . tcx , self . mir , self . mdpe ,
420
- Location { block : bb , statement_index : statements_len } ,
414
+ location ,
421
415
|path, s| Self :: update_bits ( sets, path, s)
422
416
)
423
417
}
@@ -448,18 +442,16 @@ impl<'a, 'tcx> BitDenotation for MovingOutStatements<'a, 'tcx> {
448
442
}
449
443
fn statement_effect ( & self ,
450
444
sets : & mut BlockSets < MoveOutIndex > ,
451
- bb : mir:: BasicBlock ,
452
- idx : usize ) {
445
+ location : Location ) {
453
446
let ( tcx, mir, move_data) = ( self . tcx , self . mir , self . move_data ( ) ) ;
454
- let stmt = & mir[ bb ] . statements [ idx ] ;
447
+ let stmt = & mir[ location . block ] . statements [ location . statement_index ] ;
455
448
let loc_map = & move_data. loc_map ;
456
449
let path_map = & move_data. path_map ;
457
450
let rev_lookup = & move_data. rev_lookup ;
458
451
459
- let loc = Location { block : bb, statement_index : idx } ;
460
452
debug ! ( "stmt {:?} at loc {:?} moves out of move_indexes {:?}" ,
461
- stmt, loc , & loc_map[ loc ] ) ;
462
- for move_index in & loc_map[ loc ] {
453
+ stmt, location , & loc_map[ location ] ) ;
454
+ for move_index in & loc_map[ location ] {
463
455
// Every path deinitialized by a *particular move*
464
456
// has corresponding bit, "gen'ed" (i.e. set)
465
457
// here, in dataflow vector
@@ -506,17 +498,15 @@ impl<'a, 'tcx> BitDenotation for MovingOutStatements<'a, 'tcx> {
506
498
507
499
fn terminator_effect ( & self ,
508
500
sets : & mut BlockSets < MoveOutIndex > ,
509
- bb : mir:: BasicBlock ,
510
- statements_len : usize )
501
+ location : Location )
511
502
{
512
503
let ( mir, move_data) = ( self . mir , self . move_data ( ) ) ;
513
- let term = mir[ bb ] . terminator ( ) ;
504
+ let term = mir[ location . block ] . terminator ( ) ;
514
505
let loc_map = & move_data. loc_map ;
515
- let loc = Location { block : bb, statement_index : statements_len } ;
516
506
debug ! ( "terminator {:?} at loc {:?} moves out of move_indexes {:?}" ,
517
- term, loc , & loc_map[ loc ] ) ;
507
+ term, location , & loc_map[ location ] ) ;
518
508
let bits_per_block = self . bits_per_block ( ) ;
519
- for move_index in & loc_map[ loc ] {
509
+ for move_index in & loc_map[ location ] {
520
510
assert ! ( move_index. index( ) < bits_per_block) ;
521
511
zero_to_one ( sets. gen_set . words_mut ( ) , * move_index) ;
522
512
}
0 commit comments