@@ -12,22 +12,22 @@ use rustc_mir_dataflow::move_paths::MoveData;
1212use std:: fmt;
1313use std:: ops:: Index ;
1414
15- crate struct BorrowSet < ' tcx > {
15+ pub struct BorrowSet < ' tcx > {
1616 /// The fundamental map relating bitvector indexes to the borrows
1717 /// in the MIR. Each borrow is also uniquely identified in the MIR
1818 /// by the `Location` of the assignment statement in which it
1919 /// appears on the right hand side. Thus the location is the map
2020 /// key, and its position in the map corresponds to `BorrowIndex`.
21- crate location_map : FxIndexMap < Location , BorrowData < ' tcx > > ,
21+ pub location_map : FxIndexMap < Location , BorrowData < ' tcx > > ,
2222
2323 /// Locations which activate borrows.
2424 /// NOTE: a given location may activate more than one borrow in the future
2525 /// when more general two-phase borrow support is introduced, but for now we
2626 /// only need to store one borrow index.
27- crate activation_map : FxHashMap < Location , Vec < BorrowIndex > > ,
27+ pub activation_map : FxHashMap < Location , Vec < BorrowIndex > > ,
2828
2929 /// Map from local to all the borrows on that local.
30- crate local_map : FxHashMap < mir:: Local , FxHashSet < BorrowIndex > > ,
30+ pub local_map : FxHashMap < mir:: Local , FxHashSet < BorrowIndex > > ,
3131
3232 crate locals_state_at_exit : LocalsStateAtExit ,
3333}
@@ -43,27 +43,27 @@ impl<'tcx> Index<BorrowIndex> for BorrowSet<'tcx> {
4343/// Location where a two-phase borrow is activated, if a borrow
4444/// is in fact a two-phase borrow.
4545#[ derive( Copy , Clone , PartialEq , Eq , Debug ) ]
46- crate enum TwoPhaseActivation {
46+ pub enum TwoPhaseActivation {
4747 NotTwoPhase ,
4848 NotActivated ,
4949 ActivatedAt ( Location ) ,
5050}
5151
5252#[ derive( Debug , Clone ) ]
53- crate struct BorrowData < ' tcx > {
53+ pub struct BorrowData < ' tcx > {
5454 /// Location where the borrow reservation starts.
5555 /// In many cases, this will be equal to the activation location but not always.
56- crate reserve_location : Location ,
56+ pub reserve_location : Location ,
5757 /// Location where the borrow is activated.
58- crate activation_location : TwoPhaseActivation ,
58+ pub activation_location : TwoPhaseActivation ,
5959 /// What kind of borrow this is
60- crate kind : mir:: BorrowKind ,
60+ pub kind : mir:: BorrowKind ,
6161 /// The region for which this borrow is live
62- crate region : RegionVid ,
62+ pub region : RegionVid ,
6363 /// Place from which we are borrowing
64- crate borrowed_place : mir:: Place < ' tcx > ,
64+ pub borrowed_place : mir:: Place < ' tcx > ,
6565 /// Place to which the borrow was stored
66- crate assigned_place : mir:: Place < ' tcx > ,
66+ pub assigned_place : mir:: Place < ' tcx > ,
6767}
6868
6969impl < ' tcx > fmt:: Display for BorrowData < ' tcx > {
@@ -78,7 +78,7 @@ impl<'tcx> fmt::Display for BorrowData<'tcx> {
7878 }
7979}
8080
81- crate enum LocalsStateAtExit {
81+ pub enum LocalsStateAtExit {
8282 AllAreInvalidated ,
8383 SomeAreInvalidated { has_storage_dead_or_moved : BitSet < Local > } ,
8484}
0 commit comments