@@ -12,22 +12,22 @@ use rustc_mir_dataflow::move_paths::MoveData;
12
12
use std:: fmt;
13
13
use std:: ops:: Index ;
14
14
15
- crate struct BorrowSet < ' tcx > {
15
+ pub struct BorrowSet < ' tcx > {
16
16
/// The fundamental map relating bitvector indexes to the borrows
17
17
/// in the MIR. Each borrow is also uniquely identified in the MIR
18
18
/// by the `Location` of the assignment statement in which it
19
19
/// appears on the right hand side. Thus the location is the map
20
20
/// 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 > > ,
22
22
23
23
/// Locations which activate borrows.
24
24
/// NOTE: a given location may activate more than one borrow in the future
25
25
/// when more general two-phase borrow support is introduced, but for now we
26
26
/// only need to store one borrow index.
27
- crate activation_map : FxHashMap < Location , Vec < BorrowIndex > > ,
27
+ pub activation_map : FxHashMap < Location , Vec < BorrowIndex > > ,
28
28
29
29
/// 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 > > ,
31
31
32
32
crate locals_state_at_exit : LocalsStateAtExit ,
33
33
}
@@ -43,27 +43,27 @@ impl<'tcx> Index<BorrowIndex> for BorrowSet<'tcx> {
43
43
/// Location where a two-phase borrow is activated, if a borrow
44
44
/// is in fact a two-phase borrow.
45
45
#[ derive( Copy , Clone , PartialEq , Eq , Debug ) ]
46
- crate enum TwoPhaseActivation {
46
+ pub enum TwoPhaseActivation {
47
47
NotTwoPhase ,
48
48
NotActivated ,
49
49
ActivatedAt ( Location ) ,
50
50
}
51
51
52
52
#[ derive( Debug , Clone ) ]
53
- crate struct BorrowData < ' tcx > {
53
+ pub struct BorrowData < ' tcx > {
54
54
/// Location where the borrow reservation starts.
55
55
/// In many cases, this will be equal to the activation location but not always.
56
- crate reserve_location : Location ,
56
+ pub reserve_location : Location ,
57
57
/// Location where the borrow is activated.
58
- crate activation_location : TwoPhaseActivation ,
58
+ pub activation_location : TwoPhaseActivation ,
59
59
/// What kind of borrow this is
60
- crate kind : mir:: BorrowKind ,
60
+ pub kind : mir:: BorrowKind ,
61
61
/// The region for which this borrow is live
62
- crate region : RegionVid ,
62
+ pub region : RegionVid ,
63
63
/// Place from which we are borrowing
64
- crate borrowed_place : mir:: Place < ' tcx > ,
64
+ pub borrowed_place : mir:: Place < ' tcx > ,
65
65
/// Place to which the borrow was stored
66
- crate assigned_place : mir:: Place < ' tcx > ,
66
+ pub assigned_place : mir:: Place < ' tcx > ,
67
67
}
68
68
69
69
impl < ' tcx > fmt:: Display for BorrowData < ' tcx > {
@@ -78,7 +78,7 @@ impl<'tcx> fmt::Display for BorrowData<'tcx> {
78
78
}
79
79
}
80
80
81
- crate enum LocalsStateAtExit {
81
+ pub enum LocalsStateAtExit {
82
82
AllAreInvalidated ,
83
83
SomeAreInvalidated { has_storage_dead_or_moved : BitSet < Local > } ,
84
84
}
0 commit comments