projects
/
web.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c1bfa02
)
fix checking Mut access on frozen location
author
Ralf Jung
<post@ralfj.de>
Mon, 15 Oct 2018 16:11:29 +0000
(18:11 +0200)
committer
Ralf Jung
<post@ralfj.de>
Mon, 15 Oct 2018 16:11:29 +0000
(18:11 +0200)
personal/_posts/2018-08-07-stacked-borrows.md
patch
|
blob
|
history
diff --git
a/personal/_posts/2018-08-07-stacked-borrows.md
b/personal/_posts/2018-08-07-stacked-borrows.md
index 94f2bb6689b7b1bd51b63c089755900ac76d09fc..37cdf504668b6fbb2ce48d9819c586125a2a34de 100644
(file)
--- a/
personal/_posts/2018-08-07-stacked-borrows.md
+++ b/
personal/_posts/2018-08-07-stacked-borrows.md
@@
-336,8
+336,11
@@
impl MemoryByte {
self.frz_since.map_or(false, |loc_t| loc_t <= acc_t),
Mut(acc_m) =>
// Raw pointers are fine with frozen locations. This is important because &Cell is raw!
- (acc_m.is_raw() && self.frozen_since.is_some()) ||
- self.borrows.last().map_or(false, |loc_itm| loc_itm == Mut(acc_m)),
+ if self.frozen_since.is_some() {
+ acc_m.is_raw()
+ } else {
+ self.borrows.last().map_or(false, |loc_itm| loc_itm == Mut(acc_m))
+ }
}
}