File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
src/tools/miri/src/borrow_tracker Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -96,7 +96,6 @@ pub struct GlobalStateInner {
96
96
/// Next unused call ID (for protectors).
97
97
next_call_id : CallId ,
98
98
/// All currently protected tags.
99
- /// An item is protected if its tag is in this set, *and* it has the "protected" bit set.
100
99
/// We add tags to this when they are created with a protector in `reborrow`, and
101
100
/// we remove tags from this when the call which is protecting them returns, in
102
101
/// `GlobalStateInner::end_call`. See `Stack::item_invalidated` for more details.
Original file line number Diff line number Diff line change @@ -7,9 +7,12 @@ use crate::borrow_tracker::BorTag;
7
7
pub struct Item ( u64 ) ;
8
8
9
9
// An Item contains 3 bitfields:
10
- // * Bits 0-61 store a BorTag
11
- // * Bits 61-63 store a Permission
12
- // * Bit 64 stores a flag which indicates if we have a protector
10
+ // * Bits 0-61 store a BorTag.
11
+ // * Bits 61-63 store a Permission.
12
+ // * Bit 64 stores a flag which indicates if we might have a protector.
13
+ // This is purely an optimization: if the bit is set, the tag *might* be
14
+ // in `protected_tags`, but if the bit is not set then the tag is definitely
15
+ // not in `protected_tags`.
13
16
const TAG_MASK : u64 = u64:: MAX >> 3 ;
14
17
const PERM_MASK : u64 = 0x3 << 61 ;
15
18
const PROTECTED_MASK : u64 = 0x1 << 63 ;
You can’t perform that action at this time.
0 commit comments