@@ -272,17 +272,6 @@ impl<'a, 'gcx, 'tcx> Borrows<'a, 'gcx, 'tcx> {
272
272
}
273
273
}
274
274
275
- /// Represents what kind of usage we've seen.
276
- enum PlaceUsageType {
277
- /// No usage seen
278
- None ,
279
- /// Has been seen as the argument to a StorageDead statement. This is required to
280
- /// gracefully handle cases where user code has an unneeded
281
- StorageKilled ,
282
- /// Has been used in borrow-activating context
283
- BorrowActivateUsage
284
- }
285
-
286
275
/// A MIR visitor that determines if a specific place is used in a two-phase activating
287
276
/// manner in a given chunk of MIR.
288
277
struct ContainsUseOfPlace < ' b , ' tcx : ' b > {
@@ -404,7 +393,8 @@ impl<'a, 'gcx, 'tcx> Borrows<'a, 'gcx, 'tcx> {
404
393
let stmt = & block_data. statements [ location. statement_index ] ;
405
394
if let mir:: StatementKind :: EndRegion ( region_scope) = stmt. kind {
406
395
if & ReScope ( region_scope) == region {
407
- // We encountered an EndRegion statement that terminates the provided region
396
+ // We encountered an EndRegion statement that terminates the provided
397
+ // region
408
398
return true ;
409
399
}
410
400
}
@@ -430,7 +420,7 @@ impl<'a, 'gcx, 'tcx> Borrows<'a, 'gcx, 'tcx> {
430
420
/// See
431
421
/// - https://github.com/rust-lang/rust/issues/48431
432
422
/// for detailed design notes.
433
- /// See the TODO in the body of the function for notes on extending support to more
423
+ /// See the FIXME in the body of the function for notes on extending support to more
434
424
/// general two-phased borrows.
435
425
fn compute_activation_location ( & self ,
436
426
start_location : Location ,
@@ -473,7 +463,7 @@ impl<'a, 'gcx, 'tcx> Borrows<'a, 'gcx, 'tcx> {
473
463
}
474
464
475
465
if self . location_contains_use ( curr_loc, assigned_place) {
476
- // TODO : Handle this case a little more gracefully. Perhaps collect
466
+ // FIXME : Handle this case a little more gracefully. Perhaps collect
477
467
// all uses in a vector, and find the point in the CFG that dominates
478
468
// all of them?
479
469
// Right now this is sufficient though since there should only be exactly
@@ -596,7 +586,9 @@ impl<'a, 'gcx, 'tcx> BitDenotation for Borrows<'a, 'gcx, 'tcx> {
596
586
// `_sets`.
597
587
}
598
588
599
- fn before_statement_effect ( & self , sets : & mut BlockSets < ReserveOrActivateIndex > , location : Location ) {
589
+ fn before_statement_effect ( & self ,
590
+ sets : & mut BlockSets < ReserveOrActivateIndex > ,
591
+ location : Location ) {
600
592
debug ! ( "Borrows::before_statement_effect sets: {:?} location: {:?}" , sets, location) ;
601
593
self . kill_loans_out_of_scope_at_location ( sets, location) ;
602
594
}
@@ -662,7 +654,6 @@ impl<'a, 'gcx, 'tcx> BitDenotation for Borrows<'a, 'gcx, 'tcx> {
662
654
663
655
// Issue #46746: Two-phase borrows handles
664
656
// stmts of form `Tmp = &mut Borrow` ...
665
- // XXX bob_twinkles experiment with removing this
666
657
match lhs {
667
658
Place :: Local ( ..) | Place :: Static ( ..) => { } // okay
668
659
Place :: Projection ( ..) => {
@@ -704,7 +695,9 @@ impl<'a, 'gcx, 'tcx> BitDenotation for Borrows<'a, 'gcx, 'tcx> {
704
695
}
705
696
}
706
697
707
- fn before_terminator_effect ( & self , sets : & mut BlockSets < ReserveOrActivateIndex > , location : Location ) {
698
+ fn before_terminator_effect ( & self ,
699
+ sets : & mut BlockSets < ReserveOrActivateIndex > ,
700
+ location : Location ) {
708
701
debug ! ( "Borrows::before_terminator_effect sets: {:?} location: {:?}" , sets, location) ;
709
702
self . kill_loans_out_of_scope_at_location ( sets, location) ;
710
703
}
0 commit comments