File tree 1 file changed +2
-2
lines changed
src/tools/miri/src/borrow_tracker/tree_borrows 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -106,6 +106,8 @@ impl LocationState {
106
106
let old_perm = self . permission ;
107
107
let transition = Permission :: perform_access ( access_kind, rel_pos, old_perm, protected)
108
108
. ok_or ( TransitionError :: ChildAccessForbidden ( old_perm) ) ?;
109
+ self . initialized |= !rel_pos. is_foreign ( ) ;
110
+ self . permission = transition. applied ( old_perm) . unwrap ( ) ;
109
111
// Why do only initialized locations cause protector errors?
110
112
// Consider two mutable references `x`, `y` into disjoint parts of
111
113
// the same allocation. A priori, these may actually both be used to
@@ -123,8 +125,6 @@ impl LocationState {
123
125
if protected && self . initialized && transition. produces_disabled ( ) {
124
126
return Err ( TransitionError :: ProtectedDisabled ( old_perm) ) ;
125
127
}
126
- self . permission = transition. applied ( old_perm) . unwrap ( ) ;
127
- self . initialized |= !rel_pos. is_foreign ( ) ;
128
128
Ok ( transition)
129
129
}
130
130
You can’t perform that action at this time.
0 commit comments