@@ -272,17 +272,6 @@ impl<'a, 'gcx, 'tcx> Borrows<'a, 'gcx, 'tcx> {
272272 }
273273 }
274274
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-
286275 /// A MIR visitor that determines if a specific place is used in a two-phase activating
287276 /// manner in a given chunk of MIR.
288277 struct ContainsUseOfPlace < ' b , ' tcx : ' b > {
@@ -404,7 +393,8 @@ impl<'a, 'gcx, 'tcx> Borrows<'a, 'gcx, 'tcx> {
404393 let stmt = & block_data. statements [ location. statement_index ] ;
405394 if let mir:: StatementKind :: EndRegion ( region_scope) = stmt. kind {
406395 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
408398 return true ;
409399 }
410400 }
@@ -430,7 +420,7 @@ impl<'a, 'gcx, 'tcx> Borrows<'a, 'gcx, 'tcx> {
430420 /// See
431421 /// - https://github.com/rust-lang/rust/issues/48431
432422 /// 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
434424 /// general two-phased borrows.
435425 fn compute_activation_location ( & self ,
436426 start_location : Location ,
@@ -473,7 +463,7 @@ impl<'a, 'gcx, 'tcx> Borrows<'a, 'gcx, 'tcx> {
473463 }
474464
475465 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
477467 // all uses in a vector, and find the point in the CFG that dominates
478468 // all of them?
479469 // 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> {
596586 // `_sets`.
597587 }
598588
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 ) {
600592 debug ! ( "Borrows::before_statement_effect sets: {:?} location: {:?}" , sets, location) ;
601593 self . kill_loans_out_of_scope_at_location ( sets, location) ;
602594 }
@@ -662,7 +654,6 @@ impl<'a, 'gcx, 'tcx> BitDenotation for Borrows<'a, 'gcx, 'tcx> {
662654
663655 // Issue #46746: Two-phase borrows handles
664656 // stmts of form `Tmp = &mut Borrow` ...
665- // XXX bob_twinkles experiment with removing this
666657 match lhs {
667658 Place :: Local ( ..) | Place :: Static ( ..) => { } // okay
668659 Place :: Projection ( ..) => {
@@ -704,7 +695,9 @@ impl<'a, 'gcx, 'tcx> BitDenotation for Borrows<'a, 'gcx, 'tcx> {
704695 }
705696 }
706697
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 ) {
708701 debug ! ( "Borrows::before_terminator_effect sets: {:?} location: {:?}" , sets, location) ;
709702 self . kill_loans_out_of_scope_at_location ( sets, location) ;
710703 }
0 commit comments