@@ -11,6 +11,22 @@ use crate::*;
1111pub mod stacked_borrows;
1212pub mod tree_borrows;
1313
14+ /// Indicates which kind of access is being performed.
15+ #[ derive( Copy , Clone , Hash , PartialEq , Eq , Debug ) ]
16+ pub enum AccessKind {
17+ Read ,
18+ Write ,
19+ }
20+
21+ impl fmt:: Display for AccessKind {
22+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
23+ match self {
24+ AccessKind :: Read => write ! ( f, "read access" ) ,
25+ AccessKind :: Write => write ! ( f, "write access" ) ,
26+ }
27+ }
28+ }
29+
1430/// Tracking pointer provenance
1531#[ derive( Copy , Clone , Hash , PartialEq , Eq , PartialOrd , Ord ) ]
1632pub struct BorTag ( NonZero < u64 > ) ;
@@ -115,15 +131,6 @@ impl VisitProvenance for GlobalStateInner {
115131/// We need interior mutable access to the global state.
116132pub type GlobalState = RefCell < GlobalStateInner > ;
117133
118- impl fmt:: Display for AccessKind {
119- fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
120- match self {
121- AccessKind :: Read => write ! ( f, "read access" ) ,
122- AccessKind :: Write => write ! ( f, "write access" ) ,
123- }
124- }
125- }
126-
127134/// Policy on whether to recurse into fields to retag
128135#[ derive( Copy , Clone , Debug ) ]
129136pub enum RetagFields {
0 commit comments